Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sorting by week number

Hi All

I have a listbox which shows me the Weekstart date - Weekend date and the Week number.

Script:

Dual(num(if( month(WeekStart( RE_DAY) )<> month(RE_DAY), 1 , day(WeekStart( RE_DAY) )),'00')

   &' - '&

   Num(if( month(WeekEnd(RE_DAY))<> month(RE_DAY), day(RE_DAY) , day(WeekEnd( RE_DAY) )),'00'),

   If(month(WeekStart( RE_DAY) )<> month( RE_DAY), 1 , day(WeekStart( RE_DAY) ))) &' Week '& Week(RE_DAY)as Weeks

2015-01-20_15-50-08.png

I would like to sort this by Week from smallest to largest e.g

Week 2

Week 3

Week 5

How can I do this cause the listbox sort propeties is not helping?

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi

Go to sort tab and select expression .

write 

=num(mid(Weeks,15,2))

you need to count your actual strings till 'k' (last string before numeric week no. ex.. 1 ,2 etc)

Hope your problem will be resolve.

View solution in original post

5 Replies
datanibbler
Champion
Champion

Hi,

there is a "formula" checkbox on the "Sort" tab in the dialog, no?

There you can enter the formula (using Subfield()) to split out the number which is the last segment in your constructed "Weeks"_field and specify ascending sort order.

HTH

Best regards,

DataNibbler

nirmalraj_kj
Partner - Contributor III
Partner - Contributor III

Have you tried the Loadorder - Orginal under the sort tab?

Anonymous
Not applicable
Author

Hi

Go to sort tab and select expression .

write 

=num(mid(Weeks,15,2))

you need to count your actual strings till 'k' (last string before numeric week no. ex.. 1 ,2 etc)

Hope your problem will be resolve.

Not applicable
Author

Thanks a lot

Anonymous
Not applicable
Author

ur welcome