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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
sarafamiglietti
Creator
Creator

How to count distinct Value having id_calendar > current id_calendar_abo

Hello

I hava a table like below:

id_aboid_calendar_aboName
15814A
25814A
35815A
45816A
55815B

When I select an id_calendar_abo, I want to create a pivot table to know the number of distinct Name having id_calendar_abo > id_calendar_abo selected

This is the pivot table I expect:

id_calendar_abo selectedcount distinct Name where id_calendar_abo > current id_calendar_abo
58142
58151
58160

My problem is :

When I select an id_calendar_abo, for example 5814, Qlikview calculates : count distinct Name where 5814>5814, so there is no result.

Can someone help me?

Thanks&Regards

Sara

1 Solution

Accepted Solutions
sarafamiglietti
Creator
Creator
Author

Hi screemannaraya,

I tried the script but it did not resolve my issue.

Finally I found a workaround by creating a separate calendar.

Thanks for your help.

Sara

View solution in original post

6 Replies
sunny_talwar

How did you get a count of 2 for 5814? There is only 1 DISTINCT NAME (A)

Capture.PNG

sarafamiglietti
Creator
Creator
Author

For id_calendar_abo = 5814, I want distinct Name in the table where id_calendar_abo > 5814.

So I want to retrieve:

5815 A

5816 A

5815 B

And if I calculate distinct name, I have A and B so 2.

Chanty4u
MVP
MVP

=Sum(Aggr(Count(id_calendar_abo)DISTINCT Name))

Chanty4u
MVP
MVP

=Count(Distinct id_calendar_abo > 5814)

Not applicable

Hi Sara,

Can you please try the attached script and let me know if you have any issues.

Thanks,
Sreeman

sarafamiglietti
Creator
Creator
Author

Hi screemannaraya,

I tried the script but it did not resolve my issue.

Finally I found a workaround by creating a separate calendar.

Thanks for your help.

Sara