8 Replies Latest reply: Apr 30, 2015 1:20 PM by Paul Van Siclen

# Class Sorting Order

Hi Genuises,

I got stuck in class sorting order

I have made a class like this below:

=SubField(Class(Due,\$(vWidth)),'<=',1) & 'to' & SubField(Class(Due,\$(vWidth)),'x <',2)

vWidth is the dynamic variable which I am taking from input box

and I am using the above class function as dimension and my expression is Sum(AmCurrLocal)

The dimension is  come like 0 to 30, 60 to 90 , 30 to 60 and so on

But its not in a sorted order

I have to submit this in 4 hours

Pls pls help me

Shashank

• ###### Re: Class Sorting Order

Go to SORT tab

Sort Your Aggregated Dimension by Numeric Value - Ascending Order

Rest all should be UNTICK

• ###### Re: Class Sorting Order

It's not working

• ###### Re: Class Sorting Order

The class function returns values with both a text format and a numeric value. So the results of the class function can be sorted by Numeric Value - Ascending. What you folks are doing is creating a pure text value by using the subfield or replace functions on the result of the class function. The resulting text values cannot be sorted numerically. What you could do is create a dual value again using the dual function: dual( subfield_expression_here , class_expression_here )

• ###### Re: Class Sorting Order

It worked!  Thanks!

• ###### Re: Class Sorting Order

I have a similar problem that I haven't figured out myself.  If anyone can figure this out it would be much appreciated.

BUMP

• ###### Re: Class Sorting Order

Try Text - Sort A-Z

• ###### Re: Class Sorting Order

Try:

=dual(replace(Class(Due,\$(vWidth)),'<= x <','to'),Class(Due,\$(vWidth)))

Then sort by Numerical Value

• ###### Re: Class Sorting Order

Thanks Michael, this worked perfectly in my Qlik Sense app!