Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Qlikview Friends,
I want to select the last date with the highest Koers.
I use this code:
tmpDir:
LOAD
FirstSortedValue(Datum, -Koers) AS DatumHoogsteKoers
Resident Koersen
Order By Datum asc;
This code works fine except when there are more dates with the same highest Koers
Who can help me.
Gysbert,
With your suggestion I created this solution.
//Hoogste koers
tmpKoers:
LOADMax(Koers) AS KoersMax
Resident Koersen;
//Datum hoogste koers
tmpDatum:LOADMax(Datum) AS DatumHoogsteKoers
Resident Koersen
Where Koers = NUM(PEEK('KoersMax' , 0, 'tmpKoers'));
LET vDatumHoogsteKoers = NUM(PEEK('DatumHoogsteKoers' , 0, 'tmpDatum'));
tmpKoersen:
Load Datum, Koers
From ...
join (tmpKoersen)
Load Datum, max(Koers) as Koers, 1 as Flag
Resident tmpKoersen;
Result:
Load max(Datum) as DatumHoogsteKoers
Resident tmpKoersen
Where Flag =1;
Gysbert,
Thanks for your reaction.
I will try to fix it with your solution.
Gysbert,
With your suggestion I created this solution.
//Hoogste koers
tmpKoers:
LOADMax(Koers) AS KoersMax
Resident Koersen;
//Datum hoogste koers
tmpDatum:LOADMax(Datum) AS DatumHoogsteKoers
Resident Koersen
Where Koers = NUM(PEEK('KoersMax' , 0, 'tmpKoers'));
LET vDatumHoogsteKoers = NUM(PEEK('DatumHoogsteKoers' , 0, 'tmpDatum'));