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: 
chipmunkG
Contributor
Contributor

how to sort the listing have value with string and text

Hi,

I have issue on sort listing that have value with string and  text for example;

1.0m, 2.0m, 4.0m,8.0m, 10.0 m, others,218k, 512k.

I want the listing to sort like 

218k

512k

1.0m

2.0m

4.0m

8.0m

10.0m

others

 

 

 

Labels (1)
1 Solution

Accepted Solutions
tresesco
MVP
MVP

You may try using sort by expression :

If(Index(Value, 'm'),Purgechar(Value,'m')*1000000,
	If(Index(Value, 'k'),Purgechar(Value,'k')*1000, 10e10))

Capture.JPG 

View solution in original post

7 Replies
Anil_Babu_Samineni

You want this in script? Or front end?

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
santhiqlik
Creator
Creator

Hi,

I would suggest to assign numeric values for that text that needs to be sorted. This can be done by creating a separate field based on the values in the text field. 

Use this numeric field in Expression in Sort tab in front end. 

fallenangel6
Creator
Creator

 
tresesco
MVP
MVP

You may try using sort by expression :

If(Index(Value, 'm'),Purgechar(Value,'m')*1000000,
	If(Index(Value, 'k'),Purgechar(Value,'k')*1000, 10e10))

Capture.JPG 

chipmunkG
Contributor
Contributor
Author

hi, already try this code but i got result like below which is only number display. how do i display the listing that i want.?

Capture1.PNG

chipmunkG
Contributor
Contributor
Author

front end. display like img below.

Capture2.PNG

chipmunkG
Contributor
Contributor
Author

thank you. that's great!