Date range 2 days back , but on Monday 4 days back?

Hello,

 

I'm making a daily scorecard based on looking @ 2 days back ( as that gives me yesterdays data in this data set

Comments

  • I think what you'd want to do there is set the card date range to something fairly inclusive, like last week or last month or all time, and have a beast mode that does that detailed filtering for you.

     

    case
    when DAYOFWEEK(CURRENT_DATE()) = 2 and `trx_date` = DATE_SUB(CURRENT_DATE(), interval 4 day) then 'Include'
    when DAYOFWEEK(CURRENT_DATE()) <> 2 and `trx_date` = DATE_SUB(CURRENT_DATE(), interval 2 day) then 'Include'
    else 'Exclude'
    end

     

     

    Or something along those lines.

    Use that beast mode to only include the "Include" values.