--------------------------------------------------...
# gooddata-platform
p
------------------------------------------------------ Separate question: Is there a way I can do percent of total metrics? E.g.
Copy code
Product category | Revenues ($) | % of total (%) |
X                |.        3000 |             25 |
Y                |.        4500 |           37.5 |
Z                |.        1500 |           12.5 |
W                |.        1500 |           12.5 |
U                |.        1500 |           12.5 |
Assume Revenues ($) is a metric and cannot be simplified to SUM(Revenues)
1
j
There is a checkbox in mertic configuration in Analytical Designer “show in %” but it is active only if there is only a single metric in insight. You can use also MAQL expression:
Copy code
SELECT Revenue($)/ (SELECT Revenue($) BY ALL OTHER)
If you add additional column (e.g. Year) and you will want to see percentage of product category for each Year and not percentage of revenue for all the years you have to use slightly different MAQL:
Copy code
SELECT Revenue($)/ (SELECT Revenue($) BY ALL Product category)
You should format such metric as percentage to see 25% instad of 0.25. Btw. I assume Revenue is additive metric so total of percentages will be 100%. If Revenue is not additive (e.g. revenue for some product is attributed to multiple product categories) the metric should still work but it will be not guaranteed that sum of all percentages will be 100%.
p
Marvellous, thanks Jakub