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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
chhavi376
Creator II
Creator II

Sorting Issue

Hi,

The requirement is :

I want to show all the values above 1000 as- 1K for 1000, 26K for 26000 etc.

And all values below 1000 as it is.

I am using the following expression:

if(Number>1000,num(Number/1000,'###.0K'),num(Number,'###,##'))

But when i double click on the label to sort, the order is not right.

Untitled.png

Can this be done?

1 Solution

Accepted Solutions
sunny_talwar

Isn't this what you want?

Capture.PNG

View solution in original post

6 Replies
sfatoux72
Partner - Specialist
Partner - Specialist

Yes

use Dual(text,number)

Your expression will be :   if(Number>1000,dual(num(Number/1000,'###.0K'),Number),Dual(num(Number,'###,##'),Number))

Regards

sunny_talwar

Or may be this:

Dual(If(Number > 1000, Num(Number/1000, '###.0K'), Num(Number,'###,##')), Number)

chhavi376
Creator II
Creator II
Author

Please check the attached QVW.

The sorting is wrong even after using DUAL.

I have tried both the expressions.

chhavi376
Creator II
Creator II
Author

I have attached the QVW.

Please have a look.

sunny_talwar

Isn't this what you want?

Capture.PNG

chhavi376
Creator II
Creator II
Author

Hi stalwar1‌,

This works right. (Y)

I figured out another solution as well,

i.e, adding the expression as dimension, and then writing an expression in the 'sort' of the dimension.

Thanks anyway.