Solved

Can I offset 'Compare to past'?


Userlevel 1
Badge

Hey Amplitude community,

 

I hope one of you have a solution to my issue here :D 

 

Question

‘Compare to past’ lets me compare to the same n days to the previous year. This comparison is date by date.

As weekdays change each year, is it possible to offset this comparison, so I compare monday - friday with monday - friday previous year?

 

Context

I’m trying to make a performance dashboard, where I’ll compare sales performance with previous year. We want to compare weekdays instead of precise dates, as that is a better explaining factor for fluctuations.

 

Solutions I’ve tried so far

2 charts: current performance vs last year performance

  1. Current performance chart: daily view of last 7 days (May 12 - May 19)
  2. Last year performance chart: daily view of last 7 days, offset by 364 days

Issues

  • I can’t present performance in the same chart
  • Offset needs to be changed on leap year (I think)

 

‘Comparing to date range ending’ on custom date

  • Current date range: last 7 days (May 12 - May 19)
  • ‘Comparing to date range ending May 20’

Issues

  • I doubt custom end date moves as days go by. Only useable for the specific week (May 12 - May 19)

Optimal outcome

1 chart where I see 7 days compared to previous year, comparing the same weekdays.

icon

Best answer by eddie.gaona 20 May 2021, 20:47

Hello @andreas_heden!

To my understanding, you want to plot M-F to the same M-F from the previous year regardless of dates changing. For example, March 8 can be a Friday one year and the next year a Saturday. 

There is no out-of-the-box way to accomplish this dynamically. I can see how offset in the “compare to past” feature would help in this case and I can submit that as a feature request.

As you have already discovered using the “custom end date” would at this time be the best approach to get what you are looking for.

View original

3 replies

Userlevel 3
Badge +2

 

  • I doubt custom end date moves as days go by. Only useable for the specific week (May 12 - May 19)

I’m 91,2% sure the custom end date moves forward as the days go by, so essentially it allows you to set the comparison period as you like. I’d at least give it a go.

I’m not sure how it interacts with leap years, though.

Userlevel 3
Badge +3

Hello @andreas_heden!

To my understanding, you want to plot M-F to the same M-F from the previous year regardless of dates changing. For example, March 8 can be a Friday one year and the next year a Saturday. 

There is no out-of-the-box way to accomplish this dynamically. I can see how offset in the “compare to past” feature would help in this case and I can submit that as a feature request.

As you have already discovered using the “custom end date” would at this time be the best approach to get what you are looking for.

Userlevel 1
Badge

 

I’m 91,2% sure the custom end date moves forward as the days go by, so essentially it allows you to set the comparison period as you like. I’d at least give it a go.

You’re right. The custom end date seems to be rolling (which essentially clears my problem).

 

@eddie.gaona it seems “custom end date” is the dynamic solution I’m looking for, so no need for submitting a feature request. Maybe add a description to “custom end date” so users know it’s a rolling date.

Reply