Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get the largest of numbers ?

I have the below scenario.

ID   LXD                RSF     TCO

1     1/12/2014        345       679

2     2/12/2014        678       890

2     3/12/2014        897       890

3     2/4/2014          666       432

3     2/4/2014          760       432

3     2/4/2014          560       666

4     7/4/2014          490       987

4     7/4/2014          490        321

1. I have to get the ID  where LXD is the latest date.

2.If LXD is same get the ID based on the highest RSF

3.If LXD AND RSF is same then get the ID based on the highests TCO.

In any scenario I should get the ID only once.So ,my staright table would look like below.

ID    LXD             RSF       TCO

1     1/12/2014      345          679

2     3/12/2014      897          890

3     2/4/2014        760          432

4     7/4/2014        490          987

How can I acheive this ?Thanks much.

13 Replies
sunny_talwar

I was trying to create a sorting list for the FirstSortedValue()

Look at how the number look in a straighttable to understand each ID will have the max ((LXD*1000000)+(RSF*1000)+TCO) for the places based on the logic provided.

Date most important -> * 1000000

RSF second most important -> *1000

TCO is third most imporant -> * 1

Capture.PNG

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

I picked 1000000 and 1000 because the RSF and TCO values both seem to be smaller than 1000. If you multiply RSF by 1000 then it will always be larger than TCO. So if you add RSF and TCO you get a number that can be used to sort by RSF first and TCO second. And if you multiply RSF by 1000 to make sure you get a number that's always larger then TCO then you make LXD a thousand times larger than RSF*1000. So LXD is multiplied by 1000*1000.


talk is cheap, supply exceeds demand
HirisH_V7
Master
Master

ThanK you.... sunindia‌ and gwassenaar.

HirisH
sunny_talwar

No problem