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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Simple Sort by Expression

I have a Day of Week list that uses the Weekday function to determine the day of the week.  I set it up so that it has seven columns, and I get Mon trhough Sun in the list.  I want Sun through Sat.

I tried loading a sort column:

                if(weekday(Date)='Sun',-1,num(weekday(Date))) as WeekDaySort,

And this produces the correct numerical order that I want the sort to use.

In my List Box, on the sort tab, I placed the WeekDaySort field in the Expression, checked the Expression box, and get the correct ordering - UNTIL a selection is made.  Then the ordering changes, whether or not the State is selected, with any of the three choices....  When I make a list with just the WeekDaySort, the order doesn't change at all after selections.

1 Solution

Accepted Solutions
Not applicable
Author

dual(weekday(Date),if(weekday(Date)='Sun',-1,num(weekday(Date)))) as Weekday,

Then sort numerical

View solution in original post

3 Replies
Not applicable
Author

dual(weekday(Date),if(weekday(Date)='Sun',-1,num(weekday(Date)))) as Weekday,

Then sort numerical

m_woolf
Master II
Master II

Make a series of 7 listboxes. Each one displays a single day. Use an expression like this:

=if(Weekday(Weekday) = 'Sun',Weekday)

Make each lisbox small and set them side by side.

What a pain!

Not applicable
Author

Works great - thank you both for responding so quickly and for having the right answer!