Hi all,
I am working on a Design Studio Dashboard which is retrieving data from a HANA calculation view.
I would like to be able to calculate a percentage share of total in Design Studio.
I have checked the 1.6 version because that should support calculations at runtime.
t
The Dynamic Calculation is providing me the exact required output (adding a new column and show the percentage contribution:
However the HANA datasource which I am using does not support these dynamic calculations.
On the measures I do not see any option to add local calculations:
Is there a similar feature in the Calculations at Runtime ? And more important where are the Calculations at Runtime applied in DS ?
I know we can solve this in HANA by adding the percentage calculation over there but that is additional effort since we are having multiple levels of aggregations. For each level of aggregation we need to do the calculation of the total before we can filter the information towards DS.
That is making the model more complex than needed. I would like to apply this percentage contribution in DS after the resultset is retrieved.
Thanks for your suggestions, input !!
Hi Gert,
Here is a scripting approach for calculating percentage contribution client side that works with BW. You could try to see if it also works with your HANA calculation view.
The basic steps are as follows:
1. In your data source, make sure the "Show Totals" option is selected for each of the dimensions as shown below:
2. Hopefully, like a BW data source, this will calculate OLAP aggregates for each dimension level (as shown above) without you having to explicitly define the aggregates in the HANA calculation view itself, so that your Initial View looks something like this:
3. Calculate Percentage Contribution at the required totals with a script like the following:
// Use variables to dynamically specify dimension member values for data selection
var myRegion = "D";
var myWeekday = "3";
var myAirline = "20363";
// Determine individual measure value
var myValue = DS_1.getData("006EIC2OSTY35SPMRNDFV5VVM", {"ZAIRLINID__ZAIREGN":myRegion,"0WEEKDAY1":myWeekday,"ZAIRLINID":myAirline}).value;
// Determine total at the required aggregation level by specifying only the aggregation dimensions
var myTotal = DS_1.getData("006EIC2OSTY35SPMRNDFV5VVM", {"ZAIRLINID__ZAIREGN":myRegion,"0WEEKDAY1":myWeekday}).value;
// Calculate Percentage Contribution
var myPercentageContribution = (myValue / myTotal * 100);
// Display Results
TEXT_VALUE.setText(myValue + "");
TEXT_TOTAL.setText(myTotal + "");
TEXT_PERCENTAGE_CONTRIBUTION.setText(myPercentageContribution + "");
The important points to note with the scripting are as follows:
I hope that makes sense.
4. The sample output looks like this:
The challenge with the above approach would be to display all the calculations in a tabular format, so another calculation approach you could try is the one described in the following blog post: Design Studio 1.6 - Data Blending with Data Iterator & Bring Your Own Data Source
Regards,
Mustafa.
Please check the PAM / Product Availability Matrix at https://support.sap.com/content/dam/library/ssp/infopages/pam-essentials/SBOP_DSTUDIO_16.pdf
See page 5; my guess is it depends on version/SP you have for HANA
Add a comment