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

RANK TABLE

Hi!

From the table that i put in my question file, i need to create tables like that, where numbers are the ranking depending on the average value. If the average is the same, the rank will be the same.

Thanks for your help.

  

table 1 only with pto
ptoQ1_EQ2_EQ3_EQ4_EQ1_JQ2_JQ3_JQ4_J
COM12113212
DIR23212312
JCDTOS11232134
SUBD22132212
table 2 with pto and zone
pto_zonQ1_EQ2_EQ3_EQ4_EQ1_JQ2_JQ3_JQ4_J
COM_G12111212
COM_S11112111
DIR_G22112312
DIR_M11112212
DIR_S23411111
1 Solution

Accepted Solutions
Frank_Hartmann
Master II
Master II

pivot table:

dim1 = pto

dim2 = valuelist('Q1_E','Q2_E','Q3_E','Q4_E','Q1_J','Q2_J','Q3_J','Q4_J')

Expression =

if(match( valuelist('Q1_E','Q2_E','Q3_E','Q4_E','Q1_J','Q2_J','Q3_J','Q4_J'),'Q1_E','Q2_E','Q3_E','Q4_E'),

hrank(pick(match(valuelist('Q1_E','Q2_E','Q3_E','Q4_E','Q1_J','Q2_J','Q3_J','Q4_J'),'Q1_E','Q2_E','Q3_E','Q4_E'),

    avg(E_I1),avg(E_I2),avg(E_I3),avg(E_I4),)),

hrank(pick(match(valuelist('Q1_E','Q2_E','Q3_E','Q4_E','Q1_J','Q2_J','Q3_J','Q4_J'),'Q1_J','Q2_J','Q3_J','Q4_J'),

    avg(J_I1),avg(J_I2),avg(J_I3),avg(J_I4),)))

then drag the second dimension to the upper right corner untill you see a blue horizontal line

View solution in original post

11 Replies
eva_maria
Contributor III
Contributor III
Author

Sorry i've attached the wrong file.

This is the real data table.

Regards

neelamsaroha157
Specialist II
Specialist II

You want your data to look like this -

Question_1.PNG

If yes, then try rank function.

eva_maria
Contributor III
Contributor III
Author

Hi Neelam!

Thanks for your reply.

Using rank fuction as you do in your table, sets the rankin by columns (Pto field) and I need it by rows and making difference between the questions for the employee (_E) and their boss (_J).

As you can see in my question file, for Pto COM, depending on the avg value of the employee answers, Q1_E,Q3_E and Q4_E have the same value so the rank has to be 1. Question Q2_E average is lower than the other so rank has to be 2.

For the boss, Q3_J has the highest average so rank is 1. Q2_J and Q4_J  are next so rank for both is 2. Finally Q_J has the lower average so rank is 3.

Regards

Frank_Hartmann
Master II
Master II

Is this what you are looking for?

eva_maria
Contributor III
Contributor III
Author

Hi Frank!

Thanks for your reply, is almost perfect. just missing to calculate separately the ranking of the questions of the employee (Q*_E) of those of the boss (Q*_J).


Regards


Frank_Hartmann
Master II
Master II

like this?

eva_maria
Contributor III
Contributor III
Author

Perfect!!

How did you do it??

Frank_Hartmann
Master II
Master II

pivot table:

dim1 = pto

dim2 = valuelist('Q1_E','Q2_E','Q3_E','Q4_E','Q1_J','Q2_J','Q3_J','Q4_J')

Expression =

if(match( valuelist('Q1_E','Q2_E','Q3_E','Q4_E','Q1_J','Q2_J','Q3_J','Q4_J'),'Q1_E','Q2_E','Q3_E','Q4_E'),

hrank(pick(match(valuelist('Q1_E','Q2_E','Q3_E','Q4_E','Q1_J','Q2_J','Q3_J','Q4_J'),'Q1_E','Q2_E','Q3_E','Q4_E'),

    avg(E_I1),avg(E_I2),avg(E_I3),avg(E_I4),)),

hrank(pick(match(valuelist('Q1_E','Q2_E','Q3_E','Q4_E','Q1_J','Q2_J','Q3_J','Q4_J'),'Q1_J','Q2_J','Q3_J','Q4_J'),

    avg(J_I1),avg(J_I2),avg(J_I3),avg(J_I4),)))

then drag the second dimension to the upper right corner untill you see a blue horizontal line

eva_maria
Contributor III
Contributor III
Author

Thanks for your invaluable help and for your time!!

Regards