Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
phil-ebm
Creator
Creator

Find value to max(date)

Hi

I need to find a Value from many rows to a max(date).

I have a table like this:

TeilenrDateValue
00108-2-023915.11.2011Freigabe
00108-2-023922.02.2011Freigabe
00108-2-023911.03.2010einmalige Prüfausnahme
34134-1-017217.10.2011einmalige Prüfausnahme
34134-1-017220.01.2011Freigabe
00322-2-024722.12.2012keine Freigabe
00322-2-024701.01.2011Freigabe

Now I want in a other Table for every "Teilenr" one row with the highst date and the Value from this date:

It should look like this:

Teilenrmax(Date)Value from max(Date)
00108-2-023915.11.2011Freigabe
34134-1-017217.10.2011einmalige Prüfausnahme
00322-2-024722.12.2012keine Freigabe

"Teilenr" (dimension) and "max(date)" (expression) works fine but i see no value? How can get a value for the max(date) expression?

Best regards

1 Solution

Accepted Solutions
maxgro
MVP
MVP

FirstSortedValue(Value, -Date)

View solution in original post

6 Replies
maxgro
MVP
MVP

FirstSortedValue(Value, -Date)

phil-ebm
Creator
Creator
Author

I try this first but it doesn't work

FirstsortedValue.png

anbu1984
Master III
Master III

When you are loading data in script, change your Date field to date format like

Date#(Date,'D.M.YYYY') As Date

maxgro
MVP
MVP

attachment with your data

jyothish8807
Master II
Master II

Hi Philips,

First change your date format to:

Date
11/15/2011
2/22/2011
11/3/2010
10/17/2011
1/20/2011
12/22/2012
1/1/2011

Dimension:

Teilenr

Date

Then in Expression:

firstsortedvalue(Value,-Aggr(Max(Date),Teilenr))

Reagdrs

KC

Best Regards,
KC
phil-ebm
Creator
Creator
Author

Oh guys

the problem was in the script.

After I add the ID I see, that the creater of the data-model joined an other table to this data (he says to me, there is only one table) and some rows are duplicated after the join.

after I change the join into keep, there's no problem and now everything works fine

thanks for your help