Supermetrics Support Forum

Customise day of week date range for 'Last Week' date option.

I am looking to set up a recurring weekly report for a client whose financial week runs from Saturday to Friday. Is there any way to set up a custom function that would pull 'Last Week' data within this range?




  • Hi Emily,

    Yes - the "Custom Date range" fields support 'strtotime' functions in PHP, which means you can use a variety of natural language commands for custom dynamic date ranges.

    image


    So you can use 'Last Friday' and 'Last Friday - 6' to get the Saturday before that, and it will update dynamically as those values change over time.

    image



    -Thank you

    Supermetrics Team

  • Thanks Jessica, that's super helpful.


    Would it be possible to do something similar in the split to row option?

    As in, showing a month's data divided by week in a Sat-Fri.



  • Hi Emily,


    I tested out my ideas but none of them worked as expected with trying to have the query itself do this change to go Sat to Fri. There are ways to do it externally in the sheet (such as run multiple queries, one for each week slice in the month; Pull the full data for the month and add another column that can be used with another sheet function to combine the right days; etc.)


    I can still put in the feature request - as this would probably be a new date time dimension added to a specific data source, which data sources do you need this with?


    -Thank you

    Supermetrics Team

  • Hi Jessica,


    Thanks for getting back to me on this. Your suggestion to configure it internally sounds like it should work just fine, though I could see a feature that allows to pull data on a custom day-of-week basis being potentially useful for reporting in the future. 


    Kind Regards,

    Emily

  • Oh sure! I will definitely put in a request for that (but it may take some time for it to be implemented if they do it). If you can use one of the other methods though as a "workaround" for now, that should be okay.


    -Thank you

    Supermetrics Team


Login to post a comment