Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Taking a distinct count of IDs with respect to successive dates

Hi All,

How can we take a count of distinct IDs w.r.t successive dates... That is
If the daily values of the dates are as follows :-

Jan 1 = 10 ids
Jan 2 = 20 ids (5 ids common between jan1 and jan2)
Jan 3 = 30 ids ( 7 ids common between jan1, jan2 and jan3)
Then i should be able to remove the common ids.
Hence in the YTD trend graph it should come as
Jan 1 = 10
Jan 2 = 15 (5 common ids removed between Jan 1 and Jan 2)
Jan 3 = 23 (7 common ids removed between Jan 1, Jan 2 and Jan 3)

Count(distinct(ID)) will only give me distinct id for each date. But, I need the distinct id for each date and then compare each date with its previous date and again get a distinct id between those dates. Thereafter I need to add the result with the previous dates result.


Please let me know how can we achieve this. Please reply ASAP.
Thanks in advance.

1 Reply
Not applicable
Author

use Count(distinct aggr(id,id)). This will only Count the distinct ids for the date range you've chosen. see attached file.