Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
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: 
Not applicable

Sort on straight table using class function

Hi all,

Please see below. Actually I want to sort on First Column(Net Sales Bands).

I am using expression.

replace(replace(CLASS(Aggr(sum({<DECDDT1 = {">=$(vFromDate)<=$(vToDate)"}>}[Net Sales]),accpg_accno),1000,'-'),'<=',''),'<','')

its does not sort properly if I double click on column heading.  is there any way to sort as numbers.

Thanks

Class.PNG.png
Vinay

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

DUAL(replace(replace(CLASS(Aggr(sum({<DECDDT1 = {">=$(vFromDate)<=$(vToDate)"}>}[Net Sales]),accpg_accno),1000,'-'),'<=',''),'<',''), CLASS(Aggr(sum({<DECDDT1 = {">=$(vFromDate)<=$(vToDate)"}>}[Net Sales]),accpg_accno),1000,'-'))


Now go to sort tab...

Select Number Value by Asc or desc

View solution in original post

3 Replies
MK_QSL
MVP
MVP

DUAL(replace(replace(CLASS(Aggr(sum({<DECDDT1 = {">=$(vFromDate)<=$(vToDate)"}>}[Net Sales]),accpg_accno),1000,'-'),'<=',''),'<',''), CLASS(Aggr(sum({<DECDDT1 = {">=$(vFromDate)<=$(vToDate)"}>}[Net Sales]),accpg_accno),1000,'-'))


Now go to sort tab...

Select Number Value by Asc or desc

Nicole-Smith

By using the replaces, you're changing the result of the class, which should be a dual, to a text string.  Simply getting rid of the replaces should solve this problem and allow it to sort as a number (you can use this as a Sort by Expression on the Sort tab):

CLASS(Aggr(sum({<DECDDT1 = {">=$(vFromDate)<=$(vToDate)"}>}[Net Sales]),accpg_accno),1000,'-')

Not applicable
Author

Thanks Manish & Nicola,

Its working perfect.

Regards

Vinay