Skip to Content
Technical Articles
Author's profile photo Hong Zhou

Time Dependency for Dimensions and Texts in Analytic Model

Figure 1: Time Dependency for Dimensions and Texts in Analytic Model (Source: SAP)


The SAP Datasphere Analytic Model Series is intended to provide you with useful guidance on how to utilize the new Analytic Model to leverage the potential of your data landscape. The Analytic Model allows for rich analytical modelling in a targeted modelling environment and will be THE go-to analytic consumption entity for SAP Datasphere.

This article is the 7th of the blog post series and introduces Time Dependency for Dimensions and Texts in Analytic Model. The following blogs have been published so far:

Stay tuned for more blogs around the Analytic Model in the coming weeks.

Time-Dependency enablement for dimension or text in SAP Datasphere is available since Q4.2022, it was firstly supported in Analytical Dataset. The Analytic Model supports it as well and adds the possibility to collect the reference date via a model parameter.

Business Value

Master data often changes over time. This is known as “time-dependency”. Let us take “Employee” as an example, an employee could change the marital status, the record in the system will be like this:

Figure 2: Sample data of Employee (Source: Own Image)

With this feature enabled, the report could display appropriate marital status for any given time period.

How to Apply

Modelers can specify the periods of validity of each record of your dimension or text entity. The following illustrations are based on below simple data model:

Figure 3: Simple data model for illustration (Source: Own Image)

Dimension: Employee_TimDep, is associated with Analytical Dataset: V_Sales_TD, which is the fact source of Analytic Model AM_TimeDep.

Three steps are required to implement the time-dependency feature in Analytic Model.

  • Step 1: Specify Time-Dependent Semantic Types in your Dimension or Text Entity
  • Step 2: Associate the dimension with Analytical Dataset and create Analytic Model
  • Step 3(Optional): Add a variable to allow SAP Analytics Cloud users to enter a date of their choice and show dimension members based on that key date

Step 1: Specify Time-Dependent Semantic Types in your Dimension or Text Entity

In above example of dimension: Employee_TimDep, make the changes accordingly as below:

Figure 4: Time-Dependent setting on Dimension (Source: Own Image)

By default, the “Business Date – From” and “Business Date – To” are treated inclusively, however you could change the behavior, please refer to SAP Help: Enable Time-Dependency for a Dimension or Text Entity.

Step 2: Associate the dimension with Analytical Dataset and create Analytic Model

Any Analytical Dataset pointing to a time-dependent dimension via an association automatically benefits from its time-dependent data. The dimension members and their names are displayed based on the current date by default. Technically, this means that reference date is pushed down in the WHERE condition when the dimension members or text members are selected during query execution.

For example, let’s create an association on the Analytical Dataset: V_Sales_TD.

Figure 5: Association between Dimension and Analytical Dataset (Source: Own Image)

As the reference date (aka key date) is not specified, the system uses the current date by default. Click on the button “Create Analytic Model” on the panel of Analytical Dataset: V_Sales_TD.

Figure 6: Create Analytic Model from Analytical Dataset (Source: Own Image)

After deployment of Analytic Model: AM_TimeDep, perform the data preview to verify the data. The current date is April 24th in 2023, the retrieved “Marital_Status” is “Married”.

Figure 7: Data Preview of Analytic Model (Source: Own Image)

Step 3 (Optional): Add a variable to allow SAP Analytics Cloud users to enter a date of their choice and show dimension members based on that key date

With Analytic Model, there is a new variable type called “Reference Date Variable”, which provides the flexibility of choosing a key date on your own choice.

Figure 8: Create Reference Date Variable on Analytic Model (Source: Own Image)

Note that a model can only have one reference date variable. Data preview of Analytic Model will show the prompt to set the reference date variable:

Figure 9: Prompt for Reference Date Variable (Source: Own Image)

The test data of Employee is as below:

Figure 10: Test data for Employee (Source: Own Image)

Enter “2020-04-15” as key date, the marital status shows “Single”. Enter “2020-04-16”, it shows “Married”.

Figure 11: Analytic Model Data Preview with prompt (Source: Own Image)

So far reference date variable on Analytic Model does not support scripting on default value (e.g., set to current date), SAP Analytics Cloud does offer scripting of prompts though that we can leverage to our benefit.

With the New Optimized Story Experience in SAP Analytics Cloud that unifies the story and analytic application, you could write scripting in story, e.g., on event “onInitialization” during page initial loading, set prompt of key date to current date or a calculated date (like beginning of this week).

Figure 12: Scripting default value of prompt in SAP Analytics Cloud (Source: Own Image)


This blog gave a brief introduction and detailed steps to implement time-dependency of dimensions and texts with the new Analytic Model in SAP Datasphere. The new reference date variable on Analytic Model makes it even more convenient for modelers.

Thanks for reading! I hope you find this post helpful. For any questions or feedback just leave a comment below this post.

Many thanks to Jan Fetzer for the collaboration on this blog post!

Further Links

Find more information and related blog posts on the topic page for SAP Datasphere.

If you have questions about SAP Analytics Cloud you can submit them in the Q&A area for SAP Datasphere in the SAP Community.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Sebastian Biela
      Sebastian Biela

      Great blogpost and a great feature!

      It's nice to see that already existing Analytical Datasets with this feature can be converted to an Analytic Model by simply mapping the input parameter to a new variable.

      Can't wait for more advanced possibilites like using the current date as default or dynamically set dates.

      For all Datasphere users out there just getting into this topic, I wrote a more in-depth articel about time-dependent associations in Datasphere with detailed screenshots and example data provided, check it out here:

      Author's profile photo Jorg Vandersteen
      Jorg Vandersteen


      I've implemented step 1 and 2 from your blog using the profit center remote table from BW Bridge. In a dimension view, DateTo and DateFrom are the respective business dates and Co Area and Profit Center the key fields.

      When I associate this dimension to the analytical dataset, I get a warning message saying "Your model definition looks good", but it won't save or deploy.

      Do you know what could be the reason for the error?

      Author's profile photo Stefan Jung
      Stefan Jung

      Hello Jorg,


      we're currently facing the same issue. Could you already solve it?

      Thank you in advance for your feedback.


      Kind regards


      Author's profile photo Czeitner Andras Zoltan
      Czeitner Andras Zoltan

      This Happens to me a lot as well. You need to refresh your browser and redo it again and it will work.


      Author's profile photo Tyler Rose
      Tyler Rose

      Thanks for this helpful blog, Hong Zhou.

      I'm interesting in utilizing this time dependency feature for MTD and YTD reporting. Can there only be one pair of "Business Date - From" and "Business Date - To" dates per Fact?

      For instance, if I were to set "MTD start" and "YTD start" as "From" and "Post Date" as "To", would my analytic model appropriately accept these?

      Author's profile photo Czeitner Andras Zoltan
      Czeitner Andras Zoltan

      Thank you. This method works well on the associated dimensions but I am wondering is there a way  to filter the fact table (in analytical view) with the reference variable ?