Line wise calculation in report

Discussion in 'Tally Developer' started by Rupal Agarwal, Apr 22, 2022.

    
  1. Rupal Agarwal

    Rupal Agarwal Member


    Hello everyone,

    I have created the report, and now I want to calculate the amount according to the line (like running balance)

    I am getting the correct value in 1st line but not from 2nd line onwards

    I am using :
    Code:
    Set as:If ($$Line = 1) THEN #FldOpBal + (#Fld2 + #Fld3 + #Fld4 + #Fld5)- #Fld1 else #Fld6 + (#Fld2 + #Fld3 + #Fld4 + #Fld5)- #Fld1
    line.png

    Can anyone please help
    its Very Urgent.

    Thank you :)
     


  2. balajimg

    balajimg Active Member


    $$PrevLine:#Fld6
     
    love likes this.


  3. love

    love Member


    or If ($$Line >1) then $$PrevLine:#Fld6
     


  4. Rupal Agarwal

    Rupal Agarwal Member


    it's not working in both conditions
     


  5. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    Yes it happens when you use field references in lines. this may due that fact the all the fields are populated at the same time..

    You can use $Storage reference instead of field references.. of the same line or previous lines instead in your formula

    also use Set Always : Yes
     


  6. farrakh hayat

    farrakh hayat Member


    Create a new field "LineTotal" where you make total of field 1, field2, ...............
    Then set Fld 6 as

    Set as: If ($$Line >1) then $$Number:$$PrevLine:#Fld6 + $$Number:#LineTotal Else #LineTotal
     


Share This Page