In SAP Analytics Cloud, you can add a time calculation to your chart without using the calculation editor. This allows you to create quick comparisons with your data such as Previous Year, Period over Period, Year to Date, and so on.
There are two ways to filter your visualizations using time filters:
There’s a time and place to use each, and in this post, we’ll show you some examples of how each of these time filters work.
1) Adding a time calculation
If your data includes different levels of granularity (i.e. year, quarter, month) then you can add a Time Calculation to compare your data over these periods.
First, we need to create a chart and add our measure. For this example, we’ll select Gross Margin. We also need to add Date as our time dimension.
Next, we’ll select ‘Add Time Calculation’ and choose ‘Previous Year’ from the list.
When we do this, nothing happens to our chart. It still shows our Gross Margin for All. We receive the following notification both in the chart and in the builder panel: “The Date dimension must be drilled to Year or lower level for Gross Margin – PY to appear.”
need to drill down to a lower level of granularity so that our chart can compare this years’ data with the previous year.
Once we drill down using the drill down icon within the chart, we can see our data compared with previous years. If we choose, we can continue to drill down to lower levels of granularity.
We can select any two measures in our chart, and a variance breakdown appears showing us the difference between the two data points.
Adding a variance
Another way to compare data from previous periods is to add a variance to your chart.
Following the previous example, we can remove the Time Calculation we added, then select our chart, and choose the ‘Add Variance’ option.
We can leave our Measures to ‘All Measures in Use (Dynamic)’, and for the dimension, we can select ‘Time’.
When we do that, we’re given all the different time variations such as Current Period, Previous Period, Previous Year, and so on. Select “Previous Year” for the Date dimension and click on Ok.
Now, our chart displays the variance based on the time period we selected.
Depending on your preference, there are different display options you can choose for your variance chart.
We can further drill down into any of our ranges to see a lower level of granularity and the variance will be calculated accordingly.
2) Creating a single value filter
As mentioned previously, there’s another way you can filter your visualization using time filters. First, we looked at adding a time calculation and a variance. The other way is to create a single value filter.
This option is useful for when you’re using a numeric chart, which doesn’t allow you to add a time dimension. Let’s look at an example.
We’ll start by creating a numeric point chart and selecting Gross Margin as our measure. However, this chart is displaying our total Gross Margin for all time periods, which is not what we want. Rather we want to filter the chart by time, specifically 2015.
We can also add a variance so that we can see how 2015’s Gross Margin compares to the 2014’s.
To do this, we start by selecting our visualization and then adding a Time (Member) filter.
This allows us to select the exact date for which we want to filter. In this example, we want to filter our visualization by 2015.
When we select OK, the time filter is enabled and our visualization restricts the measure by the time we selected.
Next, we can follow the same workflow described in the previous example and add a variance at the year granularity, which will show us how this year’s Gross Margin compares with the previous year.
We’ve shown you two ways to filter your data by time, as well as how to add a variance to compare two values.