Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Count Distinct within a range?

Hi,

I am quite new to QlikView, few programming skills. I would like to define an expression in a chart in order to cumulative count distinct costumers.

Example

Table  

DayCustomer
1A
1B
1C
1A
2D
2A
2E
3B
3F
3F

Result

  

DayCount
13
25
36

Thanks

4 Replies
Anil_Babu_Samineni

What is the logic behind this? I am not sure how 5 & 6 are coming into the view. Would you explain more?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

Day 1 (cumulative distinct values) : 3 (A,B,C)

Day 2 (cumulative distinct values): 5 (A,B,C,D,E)

Day 3 (cumulative distinct values): 6 (A,B,C,D,E,F)

please let me know if it is clear now

Thanks

MarcoWedel

Hi,

maybe one solution could be to use an The As-Of Table:

QlikCommunity_Thread_248894_Pic1.JPG

Table:

LOAD * INLINE [

    Day, Customer

    1, A

    1, B

    1, C

    1, A

    2, D

    2, A

    2, E

    3, B

    3, F

    3, F

];

TabAsOfDays:

LOAD IterNo() as Day,

    Day as AsOfDay

Resident Table

While IterNo()<=Day;

hope this helps

regards

Marco

Not applicable
Author

Thanks for the answer, i couldn't get to work it yet since i have more fields.

Market

Year

Campaign

Day

Customer

This would work as well?

the idea es to have different values for every Market_Year_Campaign selected.