Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
qliklizzy
Creator II
Creator II

sort weekday based on todays date

Hi

I have a table of counts over the last 7 days, sorted mon tues wed...etc

is there a way of sorting by today onwards, So today is Thursday - start the sort on Friday

 

thanks

Labels (1)
10 Replies
qliklizzy
Creator II
Creator II
Author

Hi thanks for quick reply, I don't think its quite worked;

 

I have this as my dimension

=if(AdmissionDateMonth >= today()-7,weekday(AdmissionDateMonth))

if I replace with test it doesn't show results corrrect

asinha1991
Creator III
Creator III

in the sort tab choose expression, and do ascending.

in the expression write

 

fabs(num(weekday(AdmissionDateMonth))-num(weekday(today())))-(num(weekday(AdmissionDateMonth))/10)

qliklizzy
Creator II
Creator II
Author

Thanks

tired that -  it starts on Tuesday and then goes thurs, wed, fri, sat, sun, mon?

thanks

asinha1991
Creator III
Creator III

I see try this , should work

 

easier maybe

 

sum(if(weekday(AdmissionDateMonth)>weekday(today()),num(weekday(AdmissionDateMonth))-8,num(weekday(AdmissionDateMonth))))

 

 

qliklizzy
Creator II
Creator II
Author

thanks again

 

sorry but it just says allocated memory exceeded?

Frank_Hartmann
Master II
Master II

whats the date format of your admissiondatemonth field?

qliklizzy
Creator II
Creator II
Author

hi

 

04/09/2019 11:57:00

Brett_Bleess
Former Employee
Former Employee

Elizabeth, have a look at the following Help link, I think using a variable based upon Today() that you then use in the first_week_day variable may adjust things on-the fly, might be an easier solution, but I did not play with things, so I am not sure if it will actually work or not, but I wanted to toss it out.

https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/DateA...

Found a Design Blog post that may be helpful too:

https://community.qlik.com/t5/Qlik-Design-Blog/Redefining-the-Week-Start/ba-p/1473588

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.