Dimensions are data categories that are used to organize and select monitoring context instances for reporting and analysis. Some examples of dimensions are time, accounts, products, and markets. Dimensions are composed of one or more hierarchical levels. For example, a Location dimension can have City, Region, and Country levels.
In dimensional analysis, measures are what you add up (such as order quantity, cost of order), and dimensions are how you divide your data (such as time, customer, location, product). You might want to calculate average profit by city, or maximum salary by time.
| Dimension | Dimension levels |
|---|---|
| Location | Country, Region, City |
| Store | Store country, Store region, Store city, Store ID |
| Sales Representative | Sales Representative ID |
| Product | Product Category, Product ID |
A dimension can consist of only one level, as illustrated by Sales Representative in the preceding table. The Sales Representative dimension would be useful if you wanted to look at the total or average number of orders by sales representative.
If a dimension level has a source metric of Date or DateTime type, the dimension can have only one level. When the model is displayed, additional levels of Year, Month, and Day are automatically created in Cognos.
If a dimension level is based on a duration metric, by default the values at each dimension level are the number of milliseconds that the duration metric represents, such as 600000, 600001, 600002, and so on. These values are typically far too granular to be useful, for example, for measuring the length of a customer interaction. If you want to use a duration as a dimension, it is better to have the dimension level based on a string metric. Add a metric value expression to the string metric that is triggered when the duration metric changes. The metric value expression maps the duration into one of a set of possible values based on the number of milliseconds. For example, the string could display '0-1 days', '1-2 days', '2-3 days', and so on. In this example, a duration metric with a value of 600,000 milliseconds would be mapped to a string metric with the value of '0-1' days because it is in the range 0-86,400,000 milliseconds (there are 86,400,000 milliseconds in 24 hours).