Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Find the Date for the MAX or 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, which is 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:

  • For the MAX value, show the MAX date, corresponding to that MAX value?
  • For the MIN value, show the MIN date, corresponding to that MIN value?

Please, find QVW attached.

Thank you!

2 Replies
perumal_41
Partner - Specialist II
Partner - Specialist II

Hi,

PFA  .i hope it help to u

Not applicable
Author

Thanks Perumal, I'll check it out and see how it works!