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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
andreas_koehler
Creator II
Creator II

Need help in understanding FirstSortedValue in diagrams

Dear all,

I need to display the most frequent event per week.

The data are weeks with dates on which a certain event (A,B,C,D) occurs.

My understanding was that I create a simple table with 'week' as dimension and the following expression:

=FirstSortedValue({$}Event, - aggr(count({$} Event),Event))

I figured that the dimension would work like the 'group by' in the manual, so that I count the number of a specific event per week, sorted it descending per week and get the string of the most frequent event.

Turns out that is works when I define a week but that it doesnt work when no week is selected.

Why and what would be the solution?

I attached a little example for illustration.

As always: Thanks for any help and for your interest,

Andreas

11 Replies
sunny_talwar

I was wondering if that expression can be replicated in this thread's scenario. I think I won't over-populating this discussion and will create another thread of what I am thinking of doing.


Thanks Stefan


Best,

Sunny

andreas_koehler
Creator II
Creator II
Author

Stefan,

thanks for this inspiration.

I used it to add expressions that concat and count the events that meet a certain threshold level of occurrences.

Andreas