5 Replies Latest reply: Dec 5, 2017 8:19 AM by Max Maudin

# Value of max Date

Hi,

I Need to Show the Value of Max Date. With the values below the Expression must give as result 58.6 because 02.11.2017 is the "highest" date. How can I get it?

I tried the Expression below

FirstSortedValue(Value -(Date* 10000 + Value))

but this Expression give me 60 and not 58.6

Any Idea?

 Value Date 57.2 10.03.2017 53.475 28.10.2017 58.6 02.11.2017 60 10.02.2017 60 03.03.2017 60 03.07.2017 60 28.07.2017 60. 29.09.2017
• ###### Re: Value of max Date

And 2nd Question is how can i include this into a set Analysis:

e.g.

sum({\$<Custer_Status={'X'},FirstSortedValue(Value, -Date)>}value) ?

• ###### Re: Value of max Date

In the script; you make sure that qlik is treating ur date field as a date by doing as folloow

field1,

....,

date(date#(Date,'DD.MM.YYYY')) as Date,

...

and then, u can this expression in a kpi for example:

sum({<Date={"\$(=max(Date))"}>}Value)

or create a table:

dimension : Date

measure : sum({<Date={"\$(=max(Date))"}>}Value)

• ###### Re: Value of max Date

Thanks, but in the script the date is already defined as SET DateFormat='DD.MM.YYYY'; This should be enough or not?

If I want to do this with a firstsortedvalue function; how can I include a firstvalue function into a Set Analysis expression?

• ###### Re: Value of max Date

just firstsortedvalue (Value, -Date)

result:

• ###### Re: Value of max Date

yes, worked now..ty