Examples of cube rules
These simple examples of cube rules are written as they would appear mathematically. When writing these rules as cube rules, the left-hand portion of the equation would be considered the target and the right-hand portion the source. That is, you would write the left-hand portion of the equation in the Target pane of the Edit Cube Rule dialog and the right-hand portion of the equation in the Rule pane.
See The Edit Cube Rule dialog.
Simple arithmetical rules:
['Price','Brazil']=2
['Price','Brazil']=['Sales']/['Units']*1000
['Price','Brazil']=(['Sales']-['Returns'])/['Units']*1000
In the latter two rules, OLAP Server will automatically use ['Sales','Brazil'],['Returns','Brazil'] and ['Units','Brazil'] although only ['Sales'],['Units'] and ['Returns'] were specified.
['Sales','Brazil']=['Sales','South America']*['Sales Percentage','Brazil']
Rules using text:
['Price','Brazil']='N/A'
Rules using rules functions
['Price','Bolivia']=MAX(['List Price'],['Extended Price'])
Rules using IF statements:
['Variance']=IF(['Actual']>['Budget'],'Good',['Actual']-['Budget'])
['Variance']=IF(['Actual']>['Budget'],'Good',['Actual']-['Budget'])
Rules referring to external cubes:
['Local Currency']= :['Head Office Currency']*DB('EXCHRATE',!Years,!Regions,!Months)