Graphing a Custom Date Range and the Values from Prior Period

Is there a simple way to show a comparison to the prior range in Sigma?

Our main output goal is to allow the user to select a date range (or a base date and number of days to look back) and show a measure as a line graph… but also to show a secondary line overlaid on the same X-axis, but for the prior same number of days.

1 Like

To get this working, we need 3 things:
1.1) parent table
1.2) Date Picker for our “Start Date”
1.3) Number input for “X Days Prior”

From there we can add 2 columns to our Parent table
2.1) A Check to see if the row is within the date picker and the X number of days prior using the Between() and DateAdd() with a minus amount functions

2.2) A column using the self lookup function to get the value from the date x days prior

Finally we can graph the Date on our X, and both the Aggregate Calc Column and the Prior Period Columns on the Y. The last step is to filter the Chart "Within our Date Range column from step 2.1 to only true. Note we cant do this filter in the parent as the prior periods would not be accessible.

The result is

Hope this helps!