Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
So I am looking for a different way to order weekdays. I want the weekday of today to be the first in a barchart. Today is a friday for example, so I want the figure to display: fri - sat - sun - mon - tue - wed - thu.
This is what I am currently trying, but it gives a wrong, random order:
=IF(weekday([datefield])=weekday(today()),1,
IF(weekday([datefield])=weekday(today()+1),2,
IF(weekday([datefield])=WeekDay(today()+2),3,
IF(weekday([datefield])=weekday(today()+3),4,
IF(weekday([datefield])=weekday(today()+4),5,
IF(weekday([datefield])=weekday(today()+5),6,7))))))
I'm looking forward to seeing your solutions! Thanks in advance.
Hi Bart,
the most simple/clean would be, i guess, to change this variable in the load script: (this of course means it will be applied everywhere in your app)
SET FirstWeekDay=0;
change that to: SET FirstWeekDay=4;
so when sorting your days, you'll get fridays first:
ow and if you want that to be "dynamic" per reload day,
let FirstWeekDay= weekday(today());
You can add Week Sort Order column in your table where you will specify incremental number for each weekday and add that sort order using new derived column in chart properties as required. Sorting weight for today will be required to be calculated assuming your app is refreshed on daily basis.
This should give you custome sort option.
Régards,
Rahul