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: 
mateo_florence
Partner - Contributor
Partner - Contributor

Calculating aggregates KPIs

Hello!

 

I have this expression to calculate a KPI:

=sum( aggr( FirstSortedValue( Amount, -Date ), [ID ATM] ) )

This expression sum the Amount of the max date of each ATM.  But now I have to differentiate between the ATM states (Field name: STATE_ATM).

 

I put an example to make it easy:

With my expression I get this KPI: 30.000 € (Total Amount)

Now I need to differentiate between 'Active' and ' Inactive':

    - STATE_ATM='Active' -> 20.000 €

    STATE_ATM='Inactive' -> 10.000 €

 

Any suggestion to get my KPIs??

 

Thanks!!

 

Labels (4)
1 Solution

Accepted Solutions
dwforest
Specialist II
Specialist II

=sum( aggr( FirstSortedValue({$<STATE_ATM={'Active'}>} Amount, -Date ), [ID ATM] ) )

View solution in original post

1 Reply
dwforest
Specialist II
Specialist II

=sum( aggr( FirstSortedValue({$<STATE_ATM={'Active'}>} Amount, -Date ), [ID ATM] ) )