
Product of all Percentage of all rows in a tablediagram
Stefan Wühl Oct 18, 2011 8:52 AM (in response to Martin Vierling)You could try something like
=exp(sum(total log(Percentage)))
as expression in your chart.
And maybe you want to vote for http://community.qlik.com/ideas/1105
Regards,
Stefan

Product of all Percentage of all rows in a tablediagram
Martin Vierling Oct 18, 2011 9:08 AM (in response to Stefan Wühl )Hi Stefan,
thanks, but this only gives me 100% for all rows...
And i voted.
Martin

Re: Product of all Percentage of all rows in a tablediagram
Stefan Wühl Oct 18, 2011 9:11 AM (in response to Martin Vierling)See attached for a sample.
How do you calculate your percentage?
Stefan

ProductPercentage.qvw 135.5 K

Re: Product of all Percentage of all rows in a tablediagram
Martin Vierling Oct 18, 2011 9:27 AM (in response to Stefan Wühl )Hi,
my percentage is something like "sum(CounterM) / sum(VK_MENGE)"
Thanks,
Martin

Product of all Percentage of all rows in a tablediagram
Stefan Wühl Oct 18, 2011 9:31 AM (in response to Martin Vierling)Then try something like
exp(sum(total aggr(log(sum(CounterM) / sum(VK_MENGE)),Account)))

Re: Product of all Percentage of all rows in a tablediagram
Martin Vierling Oct 18, 2011 9:44 AM (in response to Stefan Wühl )Hmm... like that I get only 0% everywhere... and when I use another expression with "sum(CounterM) / sum(VK_MENGE)" as xxx and use the result of this in the main formula "exp(sum(total aggr(log(xxx),Account)))", I get a 100% everywhere... can you see my mistake?

Re: Product of all Percentage of all rows in a tablediagram
Stefan Wühl Oct 18, 2011 9:51 AM (in response to Martin Vierling)Could you upload a simplified version of your app here in the forum? Or just some LOAD INLINE tables as text?

Re: Product of all Percentage of all rows in a tablediagram
Martin Vierling Oct 18, 2011 10:34 AM (in response to Stefan Wühl )Here we go. :)

ProductOfOverallPercentages.qvw 186.0 K

Re: Product of all Percentage of all rows in a tablediagram
Stefan Wühl Oct 18, 2011 11:02 AM (in response to Martin Vierling)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

ProductOfOverallPercentages2.qvw 187.0 K





Re: Product of all Percentage of all rows in a tablediagram
Stefan Wühl Oct 18, 2011 9:44 AM (in response to Stefan Wühl )Some more examples.
Stefan

ProductPercentage2.qvw 139.0 K





Re: Product of all Percentage of all rows in a tablediagram
Martin Vierling Oct 18, 2011 9:12 AM (in response to Martin Vierling)If I would get the product of all percentages as a total row it would also be ok:
Account Percentage A 50%
B 30% C 60% Total 9% Thanks,
Martin

