Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
PercentSum Problem
jlux33
<p>I have a dataset that returns data similar to (Note: dashes are to indicate field separation):</p><p> </p><p>Type - Daily - Weekly - Monthly - Yearly</p><p>T1 - 0 - 10 - 20 - 30</p><p>T2 - 0 - 15 - 25 - 35</p><p>T3 - 0 - 20 - 30 - 40</p><p> </p><p>When I type to do PERCENTSUM for the four colums, the Daily column will throw an error and the report fails. The business is sometimes closed, so all rows for Daily = 0.</p><p> </p><p>How can I get PERCENTSUM to return a 0 and not an error?</p><p> </p><p>Jim</p>
Find more posts tagged with
Comments
BRM
<p>I haven't used PERCENTSUM very much so I don't know why it would be failing but if Daily is always 0 and thus the % sum is always 0 then can you just hard code that (i.e. with a label) so your report looks the way it should but doesn't fail?</p>
bgbaird
<p>You could also define aggregation datapoints for sum and count of each column, then set a third aggregation point using the safeDivide() function, or an if/else to protect your execution.</p><p> </p><p>Brian</p>
jlux33
<p>The Daily amount isn't "always" zero, only when the store(s) are closed, so can't hard code a value.</p><p> </p><p>Aggregations data points for sum and count won't work. The PERCENTSUM function tells you what percent the row is of the column total. An aggregation on a row will just equal the row, so it won't work.</p><p> </p><p>Thank for the thoughts.</p><p> </p><p>Jim</p>