Skip to main content
Solved

Query to pull month to date compared to same dates a month ago

  • August 14, 2024
  • 2 replies
  • 100 views

phdigital
Forum|alt.badge.img

Hi team, 

I was wondering if there was a way to modify the query dates to compare the same dates a month ago. There is only an option for same dates a year ago. ie Compare 1-14th Aug 2024 to 1-14 Jul 2024.

Thank you!

 

 

Best answer by Kathy

Hi, 

Great question. You need to use advanced date selection in order to achieve this. Right where you are under “compared to”, select custom date range and type the following:

Start date: 

last day of -2 months

End date: 

yesterday last month

 


Advanced date selection can be done by typing anything accepted by PHP's strtotime, which is what we are using in the example above. 

Have a great day!

2 replies

Kathy
Forum|alt.badge.img+2
  • Supermetrics Team
  • 10 replies
  • Answer
  • August 15, 2024

Hi, 

Great question. You need to use advanced date selection in order to achieve this. Right where you are under “compared to”, select custom date range and type the following:

Start date: 

last day of -2 months

End date: 

yesterday last month

 


Advanced date selection can be done by typing anything accepted by PHP's strtotime, which is what we are using in the example above. 

Have a great day!


phdigital
Forum|alt.badge.img
  • Author
  • Newbie
  • 1 reply
  • August 15, 2024

Awesome thanks so much Kathy. Much appreciated.