Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

asaskal5
New Contributor

Sorting week days

I have created a listbox with the weekdays. However they are lined in the wrong order. How can I correct this? I tried the sort by expresion option but couldn't succeed to sort them in the correct order. Thanks

1 Solution

Accepted Solutions
vinieme12
Esteemed Contributor II

Re: Sorting week days

how are you creating your weekdays?

maybe use Sort by Expression

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

View solution in original post

10 Replies
MVP
MVP

Re: Sorting week days

Could you post a sample/screenshot?

vinieme12
Esteemed Contributor II

Re: Sorting week days

how are you creating your weekdays?

maybe use Sort by Expression

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

View solution in original post

sergio0592
Valued Contributor II

Re: Sorting week days

Try with Properties/Sort/Sort by expression

and as expression : index('mon  thue  wed  thur   frid  sat  sun', WeekDayField)

Partner
Partner

Re: Sorting week days

maybe this (sorts correct in my app)

only({1}weekday(yourdatefield))

Re: Sorting week days

Better if you add one inline table in your data model and connect the Weekdays field with your Weekdays field in data model this will effective worked here.

WeeDaysSort:

Load * Inline

[

WeekDays,SortOrder

Mon,1

Tue,2

Wed,3

Thu,4

Fri,5

Sat,6

Sun,7

];


Regards

Anand

Partner
Partner

Re: Sorting week days

Hi

find attached screenshot

use this expression:- Match(WeekDay,'Mon','Tue','Wed','Thu','Fri','Sat','Sun') in sort tab


Task.JPG

Re: Sorting week days

If you required this in the front end UI then better you can do this way on your chart sort properties.

Ex:-

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


asaskal5
New Contributor

Re: Sorting week days

thank you very much

dezmundw15
New Contributor III

Re: Sorting week days

I was having an issue sorting my date and the formula you provided worked!

Thanks,

Desmond