Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a nice problem:
There is a table (diagram) containing a number of rows, a dimension and a percentage:
Account | Percentage |
---|---|
A | 50% |
B | 30% |
C | 60% |
What I want to see, is the product of all percentages (50% x 30% x 60% -> 0.5 x 0.3 x 0.6 -> 0.09 -> 9%) as a column:
Account | Percentage |
---|---|
A | 9% |
B | 9% |
C | 9% |
How can I achieve this?
Thanks a lot in advance,
Martin
Here we go. 🙂
I think something like
exp(sum(total aggr( log( Expression3/Expression1),TransID)))
in fact does work also in your example. It's just that your numbers are getting pretty small (note that we use a Product function here...).
You also have sometime multiple records per TransID, so you might want to use an aggregation on the percentage, maybe
exp(sum(total aggr( log( sum(Expression3)/sum(Expression1)),TransID)))
or
exp(sum(total aggr( log( sum(Expression3/Expression1)),TransID)))
depending what you want to achieve.
edit: see attached your data with more decimal places added