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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
abhijith28
Creator II
Creator II

Sorting based on two columns in qliksense straight table

Hi,

I have a scenario where sorting in straight table should be done on two columns.

1. Name sort by alphabetical order

2. Value sort by Sort_ord within the name

Ex: Input

abhijith28_0-1649144418639.png

Expected Output

abhijith28_1-1649144437405.png

I tried sorting option 1. sort by Name alphabetical 2. sum(Sort_ord) but its not working for few names attached in the Data.xls

I have attached the sample app and sample source data. Please look into it.

Labels (1)
1 Solution

Accepted Solutions
brunobertels
Master
Master

Hi 

Then do it like that 

replace dim value by this calculated dimension : 

=dual(Value,Sort_ord)

Let column Sort_ord but add 0 in the show column if option 

 

like that : 

brunobertels_1-1649171797274.png

 

 

and as result : 

brunobertels_2-1649171817110.png

 

 

View solution in original post

7 Replies
brunobertels
Master
Master

Hi 

 

Is this what you need ? 

brunobertels_0-1649148400137.png

 

if yes is the Order in sorting menu option : 

brunobertels_1-1649148467491.png

 

 

abhijith28
Creator II
Creator II
Author

HI @brunobertels 

Output is correct but the Sort_ord column should not be added in the table.

Only Name & Value should be there in the table

brunobertels
Master
Master

Hi 

Then do it like that 

replace dim value by this calculated dimension : 

=dual(Value,Sort_ord)

Let column Sort_ord but add 0 in the show column if option 

 

like that : 

brunobertels_1-1649171797274.png

 

 

and as result : 

brunobertels_2-1649171817110.png

 

 

abhijith28
Creator II
Creator II
Author

@brunobertels 

Great! It is working as expected. 

Thanks for your time & providing the solution.

But if you select Value "A" from first cell only that particular cell value will be selected. It won't select A from all Names. How do we tackle this issue.

abhijith28
Creator II
Creator II
Author

@MarcoWedel  @Anil_Babu_Samineni @tresB 

Do you have any solution to this scenario. Please suggest

brunobertels
Master
Master

Hi 

This seems to work for me : 

Dim = Name

Dim = Value

 

Sort Order : 

Name = Auto 

Value = order by expression ascending 

add this expression aggr(min(Sort_Ord),Value)

 

selecting first Value in Value Field ( A) seems to select all respective value corresponding to 'A' : 

brunobertels_0-1649344919374.png

 

abhijith28
Creator II
Creator II
Author

@brunobertels 

Thanks for the response.

Tried it but if you see the third value is showing it as B instead it should show X-B