Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I am creating a straight table to display previous and current value. i am plannign to write in the fron end. but how to write in set analysis? any example?
For exmaple: I want to display out a ranking of an item - current is Rank1, previous is rank 5. So, i need to create an expression to display the previous value.
Rgds,
Jim
Hi Jim,
I am newbie but here is what I did for you:
max({<Year={$(vThisYear)}>}Rank)
max({<Year={$(vPreviousYear)}>}Rank)
Note: use min() or max() depending on your ranking system (if its ascending or descending)
vThisYear=max(Year)
vPreviousYear=max(Year-1)
You will get a table like this:
Hope this helps.
Regards,
Dimitar
What do you mean by previous?
Has the value change since the data been re-loaded?
or the values have some condition that make the rank so they already exist in the current dataset.
Feeling Qlikngry?
Yes. it been reloaded. For instance.
Year 2015 data - record ID 123456. is rank 7
Year 2016 data - record ID 123456, ir rank 8
So, i want to create a straight table to display the record id , and its current rank(rank8) and previous rank(rank7).
Create variables for previous values and use in set anaylysis expression
Hi Jim,
I am newbie but here is what I did for you:
max({<Year={$(vThisYear)}>}Rank)
max({<Year={$(vPreviousYear)}>}Rank)
Note: use min() or max() depending on your ranking system (if its ascending or descending)
vThisYear=max(Year)
vPreviousYear=max(Year-1)
You will get a table like this:
Hope this helps.
Regards,
Dimitar