Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
satyaban
Contributor III
Contributor III

How to sort dimension on basis of its numeric values ?

Dear All,

I have a field called app version with values like

Appversion list = 1.2.3, 2.4.5, 5.4.5, 4.5.6    so on ....  like this But when bar graph is plotted it should show as 

5.45 , 4.5.6 , 2.4.5 , 1.2.3 so on ....... based on magnitude of dimension values   instead of ascending/descending sorting of measure values .

 

Kindly help how to write expression for sorting same dimension values based on magnitude values .

Note: I have applied sort numerically for dimension values  in sorting section but it is not working .

Labels (4)
2 Solutions

Accepted Solutions
StarinieriG
Partner - Specialist
Partner - Specialist

Maybe this could work

Left(PurgeChar(num,'.') & Repeat(0,Max(total Len(Purgechar(num,'.')))), Max(total Len(Purgechar(num,'.'))))

View solution in original post

asinha1991
Creator III
Creator III

sorry for throwing random things 😄 try this if it doesn't work I will load data and see

Num#(Purgechar(APP_VERSION, '.'))/pow(10,len(Purgechar(APP_VERSION, '.'))) 

View solution in original post

15 Replies
StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

try to sort by Num(Purgechar(field, '.')))

asinha1991
Creator III
Creator III

if above doesn't work, you can try this too Num#(Purgechar(field, '.')))

satyaban
Contributor III
Contributor III
Author

No It is not working .

Version numbers are not sorted 

Please find attached image

StarinieriG
Partner - Specialist
Partner - Specialist

In that screen it seems that the order is by measure.

 

Probably in sort menu, dimension (with that condition) is first than measure?

satyaban
Contributor III
Contributor III
Author

No StarinieriG,

I have used sorting for dimension .

Sorting for measure is unselected .

I have used     Num#(Purgechar(APP_VERSION, '.'))   in sort by expression for dimension field .

Please find attachment .

 

asinha1991
Creator III
Creator III

 can you dragging application version to 1 in sorting order?

StarinieriG
Partner - Specialist
Partner - Specialist

If you unselected it, but measure is before than dimension, the sort is by measure anyway

Try to do what @asinha1991  has said, and probably you'll solve your problem

satyaban
Contributor III
Contributor III
Author

I did not get your point, dragging APP_VERSION to 1 in sorting order ?

Actual requirement is if APP_VERSION are   5.6.4,  4.6.7 , 1.3.2 , 4.6.0   in default load order after sorting it should be

1.3.2 , 4.6.0 ,  4.6.7  , 5.6.4  like this from small to large number .

Note : I cannot use also Round because it contains 3 decimal point

asinha1991
Creator III
Creator III

 

 

check this image