Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

madmax88
Contributor

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?

   

ValueDate
         57.210.03.2017
          53.47528.10.2017
         58.602.11.2017
         6010.02.2017
         6003.03.2017
         6003.07.2017

         60

28.07.2017
        60.29.09.2017
1 Solution

Accepted Solutions
OmarBenSalem
Esteemed Contributor

Re: Value of max Date

just firstsortedvalue (Value, -Date)

result:

Capture.PNG

5 Replies
madmax88
Contributor

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) ?

OmarBenSalem
Esteemed Contributor

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

load

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)

madmax88
Contributor

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?

OmarBenSalem
Esteemed Contributor

Re: Value of max Date

just firstsortedvalue (Value, -Date)

result:

Capture.PNG

madmax88
Contributor

Re: Value of max Date

yes, worked now..ty

Community Browser