Comparing two date periods can be difficult, and sometimes it requires SQL or multiple reports. You have to modify the dates so that they join correctly, and then use date and time logic to get the period you want, dynamically.
The Compare Dates Transform makes this so much easier.
Simply pick the time period you want as your base, then pick what time period you want to compare it to.
Grow will then dynamically place your two periods, side by side with all the data, and dynamically update the date range to what you want. This makes it easy to calculate key values or chart this month against last month.
How to Use:
- Click 'Add Transform' then pick 'Compare Dates'
- Pick the date column you want to use to compare.
- Select the range of your base period.
- Select your comparison period.
- Click 'Done', and the transform will start calculating.
When it it is done, your base and comparison periods will be laid out side by side.
Use 'Add Data' to select the two data series and you are done.
The initial report needs to cover the entire date range
For example, if you want to compare the current month with the prior month, then the initial report needs to bring in data for the entire two-month range. (You can check this in the data settings for the specific report.) If the report is only bringing in year-to-date data, then you won't be able to compare the current month with the same month last year unless you expand the settings to include last year's data.
Remove unnecessary columns
Since this transform will double the columns that you have in your report, it is a good idea to use either the Select Columns or Group Data transforms to only see the columns you need to use before running the Compare Dates transform. This will help the transform run faster and make it easier for you to find the data you will use in your chart.
Run most transforms before this one
It won't be effective to run some transforms (like Filter Data or Group Data) after you run the Compare Dates transform. Comparing dates after you already have the data grouped and filtered how you would like is recommended.