Skip to main content
Solved

How to change starting day of week for a single report?

  • April 27, 2021
  • 0 replies
  • 94 views

I have a report which basically has only two columns, a name and a date.  I want to color-code the rows which have a date in the current week .... however I want the 'current week' to start on Tuesday instead of Sunday.  I know I can change the default starting day of the week in the app settings but I actually want the default to stay the same and only this report should have Tuesday as the starting day of the week.

This is what I currently have which highlights the current week:

If(
FirstDayOfWeek([Date]) = FirstDayOfWeek(Today()), "#FFFF00"
)

Anyone know how to modify this so it color-codes the week based on a Tuesday start day?  Thanks.

------------------------------
William William
------------------------------

Best answer by BlakeHarrison

What you'll really want to do is first figure out the Start and End dates for "The Current Week". To find the Start Date, I would use this:
If(DayOfWeek(Today())=2,Today(), PrevDayOfWeek(Today(), 2))​
For the End Date, I would do this:
If(DayOfWeek(Today())=1,Today(), NextDayOfWeek(Today(),1))​​

So your final formula would look something like this:

var date start = If(DayOfWeek(Today())=2,Today(), PrevDayOfWeek(Today(), 2))​;
var date end = If(DayOfWeek(Today())=1,Today(), NextDayOfWeek(Today(),1))​​;

If($start<=[Date] AND $end>=[Date], "#FFFF00")


------------------------------
Blake Harrison
bharrison@datablender.io
DataBlender - Quickbase Solution Provider
Atlanta GA
/ http://datablender.io/
------------------------------
This topic has been closed for replies.

  • Registered
  • Answer
  • April 28, 2021
What you'll really want to do is first figure out the Start and End dates for "The Current Week". To find the Start Date, I would use this:
If(DayOfWeek(Today())=2,Today(), PrevDayOfWeek(Today(), 2))​
For the End Date, I would do this:
If(DayOfWeek(Today())=1,Today(), NextDayOfWeek(Today(),1))​​

So your final formula would look something like this:

var date start = If(DayOfWeek(Today())=2,Today(), PrevDayOfWeek(Today(), 2))​;
var date end = If(DayOfWeek(Today())=1,Today(), NextDayOfWeek(Today(),1))​​;

If($start<=[Date] AND $end>=[Date], "#FFFF00")


------------------------------
Blake Harrison
bharrison@datablender.io
DataBlender - Quickbase Solution Provider
Atlanta GA
/ http://datablender.io/
------------------------------