Qlik Community

Ask a Question

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor III
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

8 Replies
MVP
MVP

Go to SORT tab

Sort Your Aggregated Dimension by Numeric Value - Ascending Order

Rest all should be UNTICK

Contributor III
Contributor III

It's not working

Creator III
Creator III

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

MVP & Luminary
MVP & Luminary

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
MVP
MVP

Try Text - Sort A-Z

Creator III
Creator III

It worked!  Thanks!

Image 1.png

Creator III
Creator III

Try:

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

Then sort by Numerical Value

Employee
Employee

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