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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
OmarBenSalem

Use aggr() in a set expression

Hi Qlikers ( stalwar1‌ )

Suppose I have a column ID and a column Date

example:

ID , Date

1, 2015

1,2016

1,2016

2,2017

3,2017

3,2017

3,2017

I want to know, how many times each ID is present in its max(Date)

I mean:

ID, max(Date) by ID, count ID for its max(Date)

1, 2016 , 2 times

2, 2017 , 1 time

3, 2017, 3 times

To do so:

I created a simple table:

as a dimension:

ID

as measures:

max(Date)

and

count({<Date={"$(=aggr(max(Date),ID))"}>} ID) : but this does not seem to work; am I missing sthing in the syntax/logic?

11 Replies
OmarBenSalem
Author

haha! I prefer the first method

sunny_talwar

But did it work?