Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello qlikers 🙂 ,
this is my table:
ID TimeLength Time
1 12:15:15 12.12.2012
2 00:06:53 15.12.2012
3 01:15:56 16.12.2012
4 05:14:36 18.12.2012
I want to write a Load script that me give a rank.
For example, the solution should be:
ID TimeLength Time Rank
1 12:15:15 12.12.2012 1
2 05:14:36 18.12.2012 2
3 01:15:56 16.12.2012 3
As you can see, I want to create a rank table in my load script.
But I dont know how I could get the first rank, the second and the third.
Rank:
Load
Time,
Max(TimeLength)
Resident Table;
This script snippet whould give me only all time and the same max. But I want only the first rank, and so on.
Do you have any ideas? 🙂
Thank you in advance!
If i understood correctly
Data:
load * inline [
ID,TimeLength,Time
1,12:15:15,12.12.2012
2,00:06:53,15.12.2012
3,01:15:56,16.12.2012
4,05:14:36,18.12.2012
];
Rank:
noconcatenate
load rowNo() as Rank,*
resident Data
order by TimeLength
DESC;
drop table Data;
output from Qlik
If i understood correctly
Data:
load * inline [
ID,TimeLength,Time
1,12:15:15,12.12.2012
2,00:06:53,15.12.2012
3,01:15:56,16.12.2012
4,05:14:36,18.12.2012
];
Rank:
noconcatenate
load rowNo() as Rank,*
resident Data
order by TimeLength
DESC;
drop table Data;
output from Qlik
Thank you for your support.
But in my case I only need the first 3 values, the 4 is superfluous. So I have to restrict by 3 values.
How can I do this? 🙂
if i understood 🙂
you can in dimension in Pivot table for example use:
=if(Rank<4,Rank)
and delete Null Value