Date range calculated metric - "last week" & "this week" - is today included or no?


  • David Stalker

    Your logic is sound Naveen, but unfortunately, for these pre-built references like "last week" or "n weeks ago", Explore uses a Mon–Sun week, regardless of how the user has defined their week. This has been a consistent thorn in my side since starting to use Explore.

    For example, in the screenshot below, since my set-up is set to the US regional norm of Sun–Sat weeks, as I change the number of weeks in the past for the range I want, the dates in the lines above each picker adjust to reflect a Sun–Sat week (i.e. 2021/11/21 is a Sunday and 2022/01/15 is a Saturday). But don't be fooled by this! If I were to hit apply on this screen as-is, I would see results from Mon, Nov. 22nd through Sun, Jan. 16th since THAT is when Explore considers 8 weeks ago to begin and 1 week ago to end. Confused? You SHOULD be! 

    Now, assuming this is a one-off query, the easiest fix is, once you've adjust your week range, to actually click on the radio buttons ABOVE the date pickers, next to the specific dates. Then you will get results for the full Sun–Sat range for the weeks that you intended to select!

    The problem with this is that you have to manually update your range every time to correct for this issue which is a pain if you're trying to create a running report, say, for "the last four weeks" or even just "last week"! As far as I know there's no solution on the way from Zendesk for this, so I solved it for myself by creating a custom attribute which will let me pick any one (or more) of the most recent 16 weeks so that I AM able to build running reports which will show me performance for last week. I suspect that the additional calculation needed to populate this attribute may make queries slower, but that's a price I'm definitely willing to pay until there's an official solution!

    Hope that helps! If you're interested, I'm happy to provide you with my attribute as an example.



  • Naveen Rajan

    Hi David Stalker thanks for your response.

    Are you saying that if I set a date range of "Last Week" in the (in the screen shot below) then it will be from the previous Monday to the previous Sunday?



    And are you additionally saying that the "weeks in the past" advanced option also only lands on the previous Monday? Ex: period "From the beginning of: 1 week in the past ..... To the end of: this week" - this would result with in from the previous Monday up through today, rather than Sunday through today - is that correct?

    Thanks again

  • David Stalker

    Hi again Naveen!

    It sounds like you've got the idea, despite a typo I made in the dates in my original post. I've updated that post, so that it's now correct, but here it is again, for clarity:

    Today, if you set the range filter to be from 8 weeks in the past to the end of last week, you would see results from Mon, Nov. 22nd through Sun, Jan. 16th. If you set the range from 1 week in the past to the end of last week, you would see results from Mon, Jan. 10th through Sun, Jan. 16th. 



Please sign in to leave a comment.

Powered by Zendesk