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: 
anjali0108
Partner - Creator III
Partner - Creator III

Rank of a column in load script

Hi Experts,

I have a column(let's say Up time) that has values as shown in the screenshot below:

Doubt.PNG

I just want to create another column named as Ranks as shown above that has ranks for the values of the Column Uptime .


I tried showing the Rank properly but it is coming in the pattern shown above.


I do not want to create Rank column in expression instead I want that in load script.


Could anyone please help me to create a column as shown below:


Up Time |  Rank

.99         |       4

.98         |       5

1            |       1

1            |       2

1            |       3


Thanks in advance.

3 Replies
sunny_talwar

May be this:

LOAD Uptime,

           RowNo() as Rank

Resident SomeTable

Order By Uptime desc;

ahaahaaha
Partner - Master
Partner - Master

Hi Anjali,

The attached file XLS data source. Script code

Directory;

Table1:

LOAD

     UpTime,

     Rank,

     RowNo() as ID

FROM

[3.xlsx]

(ooxml, embedded labels, table is Sheet1);

DROP Field Rank From Table1;

NoConcatenate

Table2:

LOAD

UpTime,

ID,

RecNo() as Rank

Resident Table1

Order By UpTime desc;

Left Join (Table1)

LOAD

ID,

Rank

Resident Table2;

DROP Table Table2;

DROP Field ID  From Table1;

Result

3.jpg

Regards,

Andrey

Anonymous
Not applicable

Hi Anjali,

find the attachment.

R/Murali