Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Hamid_Reza_Rashidi
Contributor
Contributor

Sort or rank a multi dimension table

Hi every body,

please be informed that i have following table, 

Ord_MahTech_NoORD_QTYSup_Gro
AzaYG2VQ5TRA
AzaYG2LB132TRA
AzaYG2995TRA
AzaYG30284TRA
Aza1000145TRA
Aza112012SBSA
Aza112021SBSA
DAYYG2VQ10TRD
DAYYG2995TRD
DAY11138120SBSD
DAY120232,880PCD
DAY11201117SBSD
DAY1120260SBSD
DAYYG2LB2TRD

I am going to give a grade the Tech_No. based on Ord_QTY in each Sup_Gro as followings:

The maximum value ,  100%

The second highest value  100%

The third highest value 90%

The 4th, 5th & 6th highest value 80 %

and ....

like following  attached table (photo), is a manual table including rank of each Tech_No 

Pivot Table.png

the Last table should be like :

Ord_MahTech_NoORD_QTYSup_GroRank
AzaYG2VQ5TRA80%
AzaYG2LB132TRA100%
AzaYG2995TRA80%
AzaYG30284TRA100%
Aza1000145TRA90%
Aza112012SBSA100%
Aza112021SBSA100%
DAYYG2VQ10TRD100%
DAYYG2995TRD100%
DAY11138120SBSD100%
DAY120232,880PCD100%
DAY11201117SBSD100%
DAY1120260SBSD90%
DAYYG2LB2TRD90%

 

Best wishes

5 Replies
Anil_Babu_Samineni

Is there any logic behind for Rank? 

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Hamid_Reza_Rashidi
Contributor
Contributor
Author

First thanks for considering my case.

For sure, i am going to use this percentages in calculation of some other fields.

Anil_Babu_Samineni

I understand that part, But how 80% is calculated in first row for rank is my question.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Hamid_Reza_Rashidi
Contributor
Contributor
Author

Hi,

would you please check the main question again.

there is three table there.

My table source is first table.

Please check the second table.

it is a pivot table of the source table.

                    (Rows) based on Ord_Mah & Tech_No 

                     (Column) based on Sup_Gro including (PCD,SBSA, SBSD,TRA,TRD)

                      Please check the columns,  SBSD & TRA, these are the examples. 

                     i want to have a new column sort the data (from max to min) and give

                     100% to max and second one.

                       90% to third highest value and ... 

for example in last table first row as following

Ord_MahTech_NoORD_QTYSup_GroRank
AzaYG2VQ5TRA80%

 

Ord_Mah is Aza (please check the second table), column TRA, as 5 is the third highest value, the Rank was 80%

hope , my descriptions be fully clear.

i am waiting for your reply or any other question.

Best wishes.

                       

 

 

 

Anil_Babu_Samineni

Sorry, It took longtime to see this. anyway, If that is not resolved can you please us to understand your logic?

Ex:

Load * Inline [

Name, Sales

A, 10

B, 20

C, 30

];

Output is this:

Name, Sales, Rank

A, 10,  3

B, 20, 2

C, 30, 1

Because, Rank column need to be calculated w.r.t the Sales of rank which is from max to min. 

Note: You can explain only one row or 2 rows to make understand clear

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful