9 Replies Latest reply: Jul 27, 2016 8:19 AM by Giuseppe De Vivo

# How to show max value with corrispondent date?

Hi, I need to show the Max Value of a serie in a KPI element with the corrispondent data.

I tried to calculate the Max Value in the KPI element with the funcio Min(field).

To show the corrispondent date, I tried to write:

if( Min(field), DATE, 'null') but it doesn't show nothing, but I don't understand why.

I tried to use a Text/Image element, but I have the same problem.

Can someone help me? Thanks.

• ###### Re: How to show max value with corrispondent date?

Try using FirstSortedValue

FirstSortedValue(DISTINCT field, -DATE)

• ###### Re: How to show max value with corrispondent date?

I've tried to apply the function you suggested but I don't obtain what I need.
I have write the expression in this way:

FirstSortedValue(distinct {1<codice_fondo= {'M3'} >} NAV, DATA)

The script editor accepts my expression, but I obtain the min value of NAV field, instead the corrispondent DATA vale.

I'm using Set Analysis too because I need NAV values of M3 set.

What is the mistake?

• ###### Re: How to show max value with corrispondent date?

For max, you need to put a negative sign next to you DATA field:

FirstSortedValue(distinct {1<codice_fondo= {'M3'} >} NAV, -DATA)

• ###### Re: How to show max value with corrispondent date?

hi,

FirstSortedValue(distinct {1<codice_fondo= {'M3'} >} NAV, -DATA)

if   DATA ----gives u lowest value

if -DATA ---gives u Maximum value

• ###### Re: How to show max value with corrispondent date?

Thank you, but my request is to show the min value with the corrispondent DATE!

At the moment, with this expression, I obtain only the value of the NAV field.

I need to show the MAX, MIN value of the NAV field and the corrispondent DATE. How can I obtain this?

• ###### Re: How to show max value with corrispondent date?

May be this:

Min Value:

Min({1<codice_fondo= {'M3'} >} NAV)

Date Associated with Min value

FirstSortedValue(DISTINCT {1<codice_fondo= {'M3'} >} DATA, NAV)

• ###### Re: How to show max value with corrispondent date?

It works thank you!

• ###### Re: How to show max value with corrispondent date?

try with sunny suggestion

FirstSortedValue(Distnct Field,-Date)

FirstSortedValue - chart function ‒ QlikView

• ###### Re: How to show max value with corrispondent date?

Use FirstSortedValue to show Max value as per date.

Example:

=FirstSortedValue(Value,-Date)