Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
eyefault
Contributor
Contributor

Date conditional KPI

Hey,

How can I make a collection sum to maximum date KPI ?

Example:

Period Revenue
202301 10
202301 15
202302 20
202302 20
202303 25
202303 15
202303 30

 

Might be result 70

I need Total 2023 revunue but function but the function should be dynamic, it should give the maximum date instead of the sum of 202303. 

5 Replies
priyanka181088
Partner - Contributor
Partner - Contributor

FirstSortedValue(Period, -Aggr(Sum(Revenue), Period))

 

i hope this helps

eyefault
Contributor
Contributor
Author

Nope 😞 it works but wrong resul. I tried with the following function, but I couldn't do Sum

Date(Max(Period)-1) 

 

BrunPierre
Partner - Master
Partner - Master

@priyanka181088 What do you expect as output?

eyefault
Contributor
Contributor
Author

25+15+30 = 70

BrunPierre
Partner - Master
Partner - Master

Sum( {$<Period = {"$(#=Max(Period))"}>} Revenue)