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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
denwo2010
Creator
Creator

How do I sort Weekday

Hi,

I have the attached Document, within the Document I have a Cyclic Group when you cycle round to the field  "DayOfWeek", I want it to be sorted as per the following:

Monday

Tuesday

Wednesday

Thursday

Friday

Saturday

Sunday

I've tried to a expression but does not work?

Has anyone any ideas on how to do this?

Thanks

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Use a dual to assign your DaysOfWeek a numerical values (useable as sort order), like:

perCal:

LOAD Db,groupB,groupC,groupD,realName,Date,Week, dual(DayOfWeek,match(DayOfWeek,'Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'))as DayOfWeek,

stddays INLINE [

    Db,groupB,groupC,groupD,realName,Date,Week,DayOfWeek,stddays

UK,TSAE,AILGNA,,ADARENDRAG LRACZOZ,31/12/2011,52,Saturday,0,

UK,TSAE,AILGNA,,ADANOTRUB NAIRBZOZ,31/12/2011,52,Saturday,0,

UK,TSAE,AILGNA,,ADA)PNB( RELWOD KRAMZOZ,31/12/2011,52,Saturday,0,

UK,TSAE,AILGNA,,ADA)2 tfihS( NEWOB PILIHPZOZ,31/12/2011,52,Saturday,0,

UK,TSAEN,SDEEL,,ADAHSLAW EVETSZOZ,31/12/2011,52,Saturday,0,

...

];

Then you can sort your column just by double clicking the appropriate header.

See also attached.

Stefan

View solution in original post

2 Replies
matt_crowther
Specialist
Specialist

In the Sort Expression box try the following:

=match(DayOfWeek,'Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday')

First suggested to me be Steven Redmond here: http://qvdesign.wordpress.com/2012/01/20/useful-alternate-sort-method-for-listboxes/

Hope that helps,

Matt - Visual Analytics Ltd

New Qlikview Design Blog: http://QVDesign.wordpress.com

swuehl
MVP
MVP

Use a dual to assign your DaysOfWeek a numerical values (useable as sort order), like:

perCal:

LOAD Db,groupB,groupC,groupD,realName,Date,Week, dual(DayOfWeek,match(DayOfWeek,'Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'))as DayOfWeek,

stddays INLINE [

    Db,groupB,groupC,groupD,realName,Date,Week,DayOfWeek,stddays

UK,TSAE,AILGNA,,ADARENDRAG LRACZOZ,31/12/2011,52,Saturday,0,

UK,TSAE,AILGNA,,ADANOTRUB NAIRBZOZ,31/12/2011,52,Saturday,0,

UK,TSAE,AILGNA,,ADA)PNB( RELWOD KRAMZOZ,31/12/2011,52,Saturday,0,

UK,TSAE,AILGNA,,ADA)2 tfihS( NEWOB PILIHPZOZ,31/12/2011,52,Saturday,0,

UK,TSAEN,SDEEL,,ADAHSLAW EVETSZOZ,31/12/2011,52,Saturday,0,

...

];

Then you can sort your column just by double clicking the appropriate header.

See also attached.

Stefan