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)
15 Replies
satyaban
Contributor III
Contributor III
Author

Yes After dragging APP_VERSION dimension field to first position over measure it is sorting but not for all values 

ex: it sort like  7.6 , 8.5, 9.1 , 7.6.1, 8.5.2 , 9.1.0 but it should be 7.6 ,7.6.1 ,8.5 , 8.5.2 ,9.1 , 9.1.0 like this

issue seems to be for decimal points values .

asinha1991
Creator III
Creator III

can you remove custom condition and sort alphabetically?

satyaban
Contributor III
Contributor III
Author

Sorry Still It is not working 
Please check attached image

StarinieriG
Partner - Specialist
Partner - Specialist

Maybe this could work

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

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, '.'))) 

satyaban
Contributor III
Contributor III
Author

Finally It worked .

Thanks a lot @asinha1991   @StarinieriG  for your quick response.

I will mark your solutions as accepted. Closing this issue 😄