Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
jleberre
Contributor II
Contributor II

Calculate difference at min/max date of a selected period

Hello

I'm trying to calculate the difference between the number of customers at the min date of the selected period, and the number of customers at the max date of the selected period.

My idea is to perform an operation like this (but not sure it is a good solution): count(customers at max date) - count(customers at min date)

I've tried :

count({<Month={'=max(Month)'}>}distinct CustomerID) ...

and

FirstSortedValue(Aggr(count(distinct CustomerID),Month),-Month) ...

But it doesn't work.

Any idea?

Thanks!

5 Replies
prat1507
Specialist
Specialist

hi

Are you using this in a text box or a chart?


Regards
Pratyush

jleberre
Contributor II
Contributor II
Author

hi

in a KPI

prat1507
Specialist
Specialist

There's no problem with the method you're using, can you plz share a sample KPI.


Regards
Pratyush

arvind_patil
Partner - Specialist III
Partner - Specialist III

Hi Julien,

Please try below one:

count({<Month={'=max(Month)'}>}distinct CustomerID) -count({<Month={'=Min(Month)'}>}distinct CustomerID)


Thanks,

Arvind Patil

jleberre
Contributor II
Contributor II
Author

I've already tested that

count({<Month={'=max(Month)'}>}distinct CustomerID) don't give the correct value

Regards