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)
Getting Percentage For A Group Subtotal From Table Total
mmah
Hi there,
I am trying to create an aggregation value which allows me to calculate the percentage of a group's subtotal from the overall total (table total). The report has been group into two levels shown below.
What I have is as follows:
1. Sub-Class Group total - 201 = $5000
301 = $6000
2. Customer Group Total - DBRF000001 = $15000
DA00000004 = $30000
3. Table-level total = $60000
So what I need to show is the percentage of $5000 of $60000 in total. I have tried a few ways:
1. Using the (row[SC_TOTAL] / reportContext.getPersistentGlobalVariable("tableTotal")) * 100. I would set that table-level aggregation's onCreate with the script reportContext.getPersistentGlobalVariable("tableTotal",this.value) - the script is placed not in the table, but when I select the TABLE_TOTAL aggregation.
2. Using (row[SC_TOTAL] / row.__outer["TABLE_TOTAL"]) * 100 on another aggregation data.
Sadly neither of those approaches work. Can someone advise on how to get that thing working? Sorry, but this is in the urgency.
Thanks in advance.
Find more posts tagged with
Comments
There are no comments yet