Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On May 18th at 10AM EDT we will answer your QlikView questions live. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
dvugopietro
Partner
Partner

First Sorted Valued, Max & Set Analysis

Hi, I'm new to Qlik.  I want to resolve the following problem in the Presentation Layer using SetAnalysis and Expression (I can't use scripting).

ID     COUNT

AA    3

BB     1

CC     4

AA     1

I want to extract the ID with the MAX(SUM(COUNT) grouped by ID) value.

In the above example I want to show both AA and CC values (4).

I thinked the following expression: =FirstSortedValue(ID,-Aggr(Sum([COUNT]),ID),1) but when there are more than one ID with the same MAX(SUM(COUNT) grouped by ID value, FirstSortedValue return NULL.

How can I write an expression with the same above purpose ?

I thinked to use Set Analysis combined with Concatenate and Max functions, but I can't figured how approaches the solution.

Thanks you.

1 Solution

Accepted Solutions
sunny_talwar

May be use this instead

Concat(Aggr(If(Sum(COUNT) = Max(TOTAL Aggr(Sum(COUNT), ID)), ID), ID), ', ')

View solution in original post

2 Replies
sunny_talwar

May be use this instead

Concat(Aggr(If(Sum(COUNT) = Max(TOTAL Aggr(Sum(COUNT), ID)), ID), ID), ', ')

View solution in original post

dvugopietro
Partner
Partner
Author

Hello Sunny.

Thanks you. The result is correct.