Qlik Community

Ask a Question

Qlik Sense App Development

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

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: 
Contributor II
Contributor II

Measure at end of period

Hello

I'm trying to calculate some measures at the end of a (selected) period, and display these measures in a KPI, a graph or a table.

  • sum({$<offer={'A'},[YearMonth]={"$(=Max([YearMonth]))"}>} subscriptions) is OK in a KPI.
  • aggr (sum({$<offer={'A'}>} subscriptions), YearMonth) is OK in a graph or table with time dimension

But I'm looking for an expression working in both cases.

I've tried to use aggr() and FirstSortedValue(. But I didn't find the good expression:

  • FirstSortedValue( aggr (sum({$<offer={'A'}>} subscriptions), YearMonth), -YearMonth): KO
  • sum( aggr( FirstSortedValue(sum({$<offer={'A'}>} subscriptions),-YearMonth), YearMonth) 😞 KO

Any idea?

Regards

2 Replies
Contributor II
Contributor II

FirstSortedValue( aggr (sum({$<offer={'A'}>} subscriptions), YearMonth), -aggr (YearMonth, YearMonth)) seems to work

Contributor II
Contributor II

I see that this kind of expression does not work:

  • With operator between two sets: FirstSortedValue( aggr (sum({$<offer={'A'}>-<customer={'x'}>} subscriptions), YearMonth), -aggr (YearMonth, YearMonth)) -> KO

  • In a pivot table with another dimension than YearMonth

Could someone help me?

Thanks!