Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

sort day (mon,tue,wed...)

Hi,

How can i do a sort on day by order Mon, Tue, Wed...Sun.

Thanks

7 Replies
oknotsen
Master III
Master III

Sort on Numeric Value.

May you live in interesting times!
tamilarasu
Champion
Champion

Use sort expression as

=Match(Day, 'Mon','Tue','Wed','Thu','Fri','Sat','Sun')

Remove all other tick marks.

Capture.PNG

MK_QSL
MVP
MVP

Go to sort tab

Select InvoiceWeekDay

Sort By Numeric Value Ascending

oknotsen
Master III
Master III

If the days are the result of the day() function (or otherwise act like a number), sorting by Numeric Value will be slightly better for performance than using Sort by Expression.

May you live in interesting times!
its_anandrjs

Hi,

You can try this way also by adding sort order table

Ex:-

Load * Inline

[

SortOrder,WeekDay

1,Mon

2,Tue

3,Wed

4,Thru

5,Fri

6,Sat

7,Sun

];

Note:- You have Weekday field in your fact table or may be calendar table if you have

Then in the chart properties go to expression and write SortOrder and uncheck all options.

Regards

Anand

tamilarasu
Champion
Champion

I agree with your point. But I was trying to show an alternate solution.

hic
Former Employee
Former Employee

You should make sure that the day is interpreted correctly as a dual, then sort it numerically. You can use e.g.

WeekDay(Date) as WeekDay

to do this.

HIC