Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
EGilbert
Contributor III
Contributor III

Max function to find results in a different dimension

I am trying to use the max result from a field to produce a value from another field.  For example in the simple chart below

 simple chart.jpg

I would like have a listbox for month and 2 text boxes for results

first text box would produce max count of sales in the selected month by a company (if month J is selected the result would be 3 because company A has a total of 3 entries in month J)

second text box would produce the company name that has the most entries in a given month(if month J is selected the result would be "A"  as the company has 3 entries which is the most for any company in month J).

I have tried aggr and concat but cannot get them to work the way i would like.

 

Labels (1)
1 Solution

Accepted Solutions
Kushal_Chawda

//For value

=max(aggr(Count(Sales),Company))

//For company

=FirstSortedValue(distinct Company, -aggr(Count(Sales),Company))

View solution in original post

1 Reply
Kushal_Chawda

//For value

=max(aggr(Count(Sales),Company))

//For company

=FirstSortedValue(distinct Company, -aggr(Count(Sales),Company))