Time series functions provide the ability to compare business performance with previous time periods, enabling you to analyze data that spans multiple time periods. For example, time series functions enable comparisons between current sales and sales a year ago, a month ago, and so on. To use time series functions, the data model must include a time dimension
When you create a time dimension, the Create Time Dimension wizard creates a table in the database, populates it with time data, creates a corresponding time dimension table in the data model, and creates a time hierarchy.
The Create Time Dimension wizard populates the source table with time data from 01-JAN-1970 to 31-DEC-2020.
- In Data Modeler, lock the model for editing.
- In the Dimension Tables area, click Add, then Create Time Dimension.
- In the Create Time Dimension wizard, specify names for the database table, the dimension table, and the hierarchy.
- In the Hierarchy Levels, specify which levels to include, such as Year, Quarter, and Month.
- Click Next.
- On the next page, review the tasks that the wizard will perform to create the time dimension.
- Click Create to enable the wizard to create the dimension.
The wizard adds a time dimension with data to the database and creates a corresponding dimension in the data model. This action might take up to 30 seconds.
- Click Done.
- To create joins between columns in the fact table and columns in the Time dimension table, click Create Join in the data model.
The time dimension has two unique columns. The DAY_TS column has the type TIMESTAMP, and the DATE_ID column has the type NUMBER. When you create a join, you specify either the column with the timestamp format or with the numeric format (depending on whether the column in the fact table has a date or number type).
- In the Joins area for the new definition, select the appropriate fact column, then select the appropriate timestamp or numeric column from the Time dimension.
After you create the joins, you can display the Hierarchies tab in the Time Dimension editor to view the default hierarchies and levels.
- Edit the tables in the model.
- Click Done to return to the data model.