At the moment our OLAP database is comprised of two data (or measure) cubes, these are the quantity of shoes sold and the value tax exclusive. These measures are dimensioned by Time, Style and Outlet. 数据挖掘研究院
From these two measures we can create others which won′t be stored by the database but will be calculated dynamically each time the user requests them. These measures are sometimes called formulas in reference to the text that defines them. 数据挖掘研究院
From the user′s point of view there is no difference between a stored measure and a formula. Both are defined by dimensions and by type. The formula Average Price, representing the average price of a pair of shoes, is dimensioned according to Time, Style and Outlet and has a decimal type. The formula is the simplest possible and reads:
Average Price = Total Value Tax Exclusive / Quantity 数据挖掘研究院
As soon as a user requires this variable, the database engine performs the required divisions to create the information. 数据挖掘实验室
It is not necessary for all of the elements of a formula to be dimensioned in the same way. For example we could define a new formula: 数据挖掘研究院
Total Value tax Inclusive = Total Value Tax Exclusive x 1.206 数据挖掘研究院
Here all the cells are individually multiplied by 1.206.
As the value added tax (VAT) rate changes (too) frequently, it is possible to create a new variable VAT, dimensioned only by time. This variable will indicate the VAT rate to apply to each position in the Time dimension. We therefore have, still very intuitively:
Total Value Tax Inclusive = Total Value Tax Exclusive x (100+VAT)/100 数据挖掘研究院
Thus, the correct total will be automatically applied to every cell to which this formula applies. 数据挖掘研究院
In the same way, if the VAT rate changes for the different products, the dimensions of the VAT variable must be Time and Product. Graphically, this variable will be a plane instead of a line.

