Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Highlighted
Partner
Partner

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!!

 

1 Solution

Accepted Solutions
dwforest
Valued Contributor

Re: Calculating aggregates KPIs

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

Re: Calculating aggregates KPIs

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