Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
madmax88
Creator II
Creator II

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

just firstsortedvalue (Value, -Date)

result:

Capture.PNG

View solution in original post

5 Replies
madmax88
Creator II
Creator II
Author

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

e.g.

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

OmarBenSalem

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
Creator II
Creator II
Author

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

just firstsortedvalue (Value, -Date)

result:

Capture.PNG

madmax88
Creator II
Creator II
Author

yes, worked now..ty