I want to fetch count of data for a specific time frame (mon-fri)-(9-17)

I have data for all hours in a day, but I want to filter out data from only business hours mon-fri (9-17)

Best Answer

  • MichelleH
    MichelleH Coach
    Answer ✓

    @dheeraj_sandhanshi You can set up a beast mode like this to segment what data to filter:

    case
      when DAYNAME(`DateField`) in ('Saturday','Sunday') then 'Exclude'
      when HOUR(`DateField`) >= 9 and HOUR(`DateField`) < 17 then 'Include'
      else 'Exclude' 
    end
    

Answers

  • MichelleH
    MichelleH Coach
    Answer ✓

    @dheeraj_sandhanshi You can set up a beast mode like this to segment what data to filter:

    case
      when DAYNAME(`DateField`) in ('Saturday','Sunday') then 'Exclude'
      when HOUR(`DateField`) >= 9 and HOUR(`DateField`) < 17 then 'Include'
      else 'Exclude' 
    end