The roleValue() function
This recipe will show you a useful function which you will often need while working with dimensional and DMR models. As the purpose of this recipe is only to examine this function, we won't consider any specific business case here.
Getting ready
Create a new list report based on the Sales and Marketing (cube) package.
How to do it...
In this recipe we will see how the roleValue()
function works and how you can use it in your reports, as follows:
In Source under Insertable Objects, locate Retailer name:
Drag it onto the list as a new column.
Now, add a new data item to the list. Define it as:
roleValue('_businessKey', [Retailer name])
.Add two more data items and define them as follows:
roleValue('_memberCaption', [Retailer name])
roleValue('_memberUniqueName', [Retailer name])
Run the report to test it:
How it works...
When defining a DMR model in the Framework Manager, the modeler can define various columns as attributes. This roleValue()
function allows you to access these...