Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I am brand new to Qlik and I am still learning what the capabilities of Qlik are.
I got a table of n entries and I want to create a new column where each entry gets a "priority number" based on conditions of other columns. The priority columns should include every integer from 1 to n.
For example if we have a table like this:
I wish to add a new column called "Priority" like you see here:
For the particular case a 1 in priority should be given to the entry with the highest value in "Z". If more than one entry has the same value of "Z" then the lowest "X" value should determine which one is 1 and which one is 2. And when the "X" values are similar as well the priority should be determined randomly.
Is this possible to do in Qlik and if so, can anybody help me how to go about it?
Thanks
Assuming you want this done in script, perhaps something along the lines of:
Temp:
Load * INLINE [
X, Y, Z
100, 5, 9
150, 6, 10
330, 8, 5
];
Load X, Y, Z, RecNo() as Priority
Resident Temp
Order by Z desc, X, Y;
Drop Table Temp;
Assuming you want this done in script, perhaps something along the lines of:
Temp:
Load * INLINE [
X, Y, Z
100, 5, 9
150, 6, 10
330, 8, 5
];
Load X, Y, Z, RecNo() as Priority
Resident Temp
Order by Z desc, X, Y;
Drop Table Temp;
Thanks for the answer Or.
It worked 🙂