Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

ranking

Hi Experts,

I have the below field in a table it’s a combination of  3 fields

Id | monthly | date.

or 

id | weekly | date

I want to rank the date for Id | monthly | date. Separately as a new field called Month Rank

I want to rank the date for Id | weekly | date Separately as a new field called Week Rank

Pleases suggest how to do that

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

If you need the columns in design mode, based on selection. I've made an application.

Best regards,

Cosmina

View solution in original post

12 Replies
sunny_talwar

How are you ranking them? Is there a measure here also?

Not applicable
Author

hi sunny

i want to rank the dates with middle word monthly as a separate field

and dates with middle word monthly as a separate field

below in the xls is the exact format i am looking for

Anonymous
Not applicable
Author

Fact:

LOAD A,

     SubField(A,'|',1) as ID,

     SubField(A,'|',2) as FlagRank,

     date#(SubField(A,'|',3),'YYYYMMDD') as Date

FROM

(ooxml, no labels, table is Sheet1);

Temp:

LOAD *, if(Peek(ID,-1)<>ID,1,Peek(Flag1,-1)+1) as Flag1

Resident Fact

order by FlagRank, ID, Date desc;

drop table Fact;

Anonymous
Not applicable
Author

And you can use in the set analyses the flag FlagRank, to show in diffrent collumn, or you can separate Fact in 2 tables based on Flag and apply the same alghoritm in the script. I hope it helps.

Anonymous
Not applicable
Author

Hi,

If you need the columns in design mode, based on selection. I've made an application.

Best regards,

Cosmina

Not applicable
Author

Hi Cosmina

this is exactly what i am looking for but the field Flag1 value needs to be in descending order

please suggest

Anonymous
Not applicable
Author

Hi,

The Flag1 has to be ascending, because the rank is using this field. As you can see in the dimension, the result is correct. Can you tell me why do you need as descending?

Best regards,

Cosmina

Not applicable
Author

hi

because the latest month should be  with flag1 1 and

MarcoWedel

Hi,

another solution might be:

QlikCommunity_Thread_242733_Pic1.JPG

table1:

Generic

LOAD SubField(A,'|',1) as ID,

    A,

    SubField(A,'|',2)&Pick(IterNo(),' date',' rank'),

    Pick(IterNo(),Date(Date#(SubField(A,'|',3),'YYYYMMDD')),AutoNumber(SubField(A,'|',3),Left(A,Index(A,'|',2))))

FROM [https://community.qlik.com/servlet/JiveServlet/download/1174373-256921/Book1.xlsx] (ooxml, no labels, table is Sheet1)

While IterNo()<=2;

hope this helps

regards

Marco