Qlik Community

Ask a Question

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements
Welcome to our newly redesigned Qlik Community! Read our blog to learn about all the new updates: READ BLOG and REPORTED ISSUES
cancel
Showing results for 
Search instead for 
Did you mean: 
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.

1 Reply
Specialist II
Specialist 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