In pivot table, for example, for each country name, I want to calculate the percentage of gdp to the total gdp of the country form.
The gdp of the certain country name (for example “Argentina”) can be obtained using sum, let’s say it is 181.357. the gdp of the certain country form (for example “Republic”) can be obtained using sum also, let’s say it is 24451.987. How could I obtain the percentage of gdp of “Republic” that belongs to “Argentina”?
ie For Argentina, we calculate 181.357/24451.987=0.74%
For China, we calculate 2256.919/24451.987=9.23%
Example source:
http://pivot.webix.com/samples/01_init/04_define_function.html
I think this should be one of the supplied value function other than sum, min,max,count, surprised nobody requested this yet.
Please advise how this can be done if I had to do it myself. This seems to need to retrieve data from a the higher aggregation level (country form level) which is not available in data parameter of custom function (at aggregation level country name).