Forum Discussion

William's avatar
William
Qrew Trainee
5 years ago
Solved

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

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...
  • BlakeHarrison's avatar
    5 years ago
    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/
    ------------------------------