Qlik Community

Qlik Sense App Development

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

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
jleberre
New Contributor

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
jleberre
New Contributor

Re: Measure at end of period

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

Highlighted
jleberre
New Contributor

Re: Measure at end of period

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!