Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Black_Hole
Creator II
Creator II

Add a value considering the date

Hello all,

I would like to add the charges fees to the amount value having the oldest period.

For example:

ChargesFeesIssue.PNG

> The expected result :

Period   | Country | %_Key_SupplierNum | %_Key_SupplierInv | Total Amount

202002  |    IT           |           S950205                 |            1JD087134         |   36263,01

202003  |    IT           |           S950205                 |            1JD087134         |   569,52

 

> My current result :(see the last column in the table below)

ChargesFeesNot.PNG

Note : I also tried to calculate that directly in the script using the function FirstSortedValue. But, the charges fees are added to all the rows in the table instead of only the row with the oldest period.

 

Please could you help me to resolve this problematic?

Thank you in advance for your help.

Labels (4)
1 Reply
edwin
Master II
Master II

try this:
create a chart, dims:  %KeySupplierum, Period
expression:  =sum([Total Amount]) + IF(Period=aggr(NODISTINCT max(Period),%_Key_SupplierNum), Charges,0)

If the period is = to the latest period for the Supplier, then add charge