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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Show the Date for the MAX/MIN value

Hello,

I have a line chart for sales and a table where you can see the detail for every sale from a particular sales rep.

What I need is to get the max and min values (sales) for a specific sales rep with the corresponding date...

I've tried it using the following expressions in a text box:

MAX: =MAX(Sales)

DATE (From MAX): =DATE(SUM(AGGR(FIRSTSORTEDVALUE(Date,-Sales),[Sales Rep])),'MM/DD/YYYY')

MIN: =MIN(Sales)

DATE (From MIN): =DATE(SUM(AGGR(FIRSTSORTEDVALUE(Date,Sales),[Sales Rep])),'MM/DD/YYYY')

Sales.png

The expression for DATE works well when I have one single value for the MAX/MIN.

In the case of MAX, the corresponding date for 60985.12 is 01/28/2010.

But, in the case of MIN, that it's 0 for sales rep Amalia Craig, there are multiple dates, and the output shows 12/30/1899.

Do you know if there's any way to show all the possible dates for the MAX/MIN sale?

Please, find QVW attached.

Thank you!

3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can concatenate the dates and use the aggr function to return that list of dates with the firstsortedvalue function. See this discussion for a similar problem: Re: FirstSortedValue issue


talk is cheap, supply exceeds demand
Not applicable
Author

Could you please give me an example? Thanks.

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

I already did.


talk is cheap, supply exceeds demand