Introduction
Comparing periods is an essential part of any analytics process.
The ability to compare how performance changes over time is the basis of any data-driven organization.
There are several options for how to build this type of analysis in Astrato.
This article will focus on the most flexible solution using measure parameters.
DVE- Build the Measures
In this example, we'll create three measures: current period, previous period, and period-over-period.
Prequists
Create a new measure for the current period
Set the aggreagtion
Open the filter section in the measure and define two filters for a date field (not the date field from the island table), comparing the field to start and end parameters.
Create another measure for the previous period, also including parameter filters.
It's essential to use different parameter names.Create a measure to calculate the period-over-period, combining the two measures.
Ensure that the parameter names are identical to the parameters used in the previous measures.
β
Workbook
Define Actions
Define an action that updates the variables value for periods after each selection in the island date.
This block assigns the min and max values to the numeric variables and then calculates the values for the string variables used in the measures.
Optionally, you can add one more block that will create a text presenting the periods for the user
The action will be something like this.
βDuplicate the block and create an event on Workbook open to set the default periods.
In the image below the default period is set to YTD
Build Visualization
Create a table with the three measures created and a selected dimension.
β
After adding the measures, ensure that the parameters are tied to the variables.
β
βAdd a Date picker control and use the island date field
β
βAdd a Text object and use the variable that describes the selected periods as the content.
β
Test
Preview the app and test it by making a selection in the date picker.
Gallery Example
Import this example from Astrato's gallery to see a complete solution
βhttps://astrato.io/data-apps/%e2%ad%95%ef%b8%8f-funnel-io-advertising-channel-template/