Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

shashank20
New Contributor III

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

Please help me to get it sorted

I have to submit this in 4 hours

Pls pls help me

Thanks in advance

Shashank

Tags (1)
8 Replies

Re: Class Sorting Order

Go to SORT tab

Sort Your Aggregated Dimension by Numeric Value - Ascending Order

Rest all should be UNTICK

shashank20
New Contributor III

Re: Class Sorting Order

It's not working

michael_gardner
Contributor III

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

Image 1.png

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 )


talk is cheap, supply exceeds demand

Re: Class Sorting Order

Try Text - Sort A-Z

michael_gardner
Contributor III

Re: Class Sorting Order

It worked!  Thanks!

Image 1.png

michael_gardner
Contributor III

Re: Class Sorting Order

Try:

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

Then sort by Numerical Value

Employee
Employee

Re: Class Sorting Order

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

Community Browser