Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
How to add new row that shows running totals
sraoj
Hi,
I have a requirement to create a report that shows the running totals, I appreciate if somebody can give me an idea about how to accomplish that. Giving an example below
the query returns
attribute month amount
A1 june 10
A1 july 40
A1 aug 30
A2 june 60
A2 july 20
A2 aug 50
...
...
There will be about 10 items, so there is no danger of running across too long
The report need to display as follows,
month A1 A2 total
june 10 60 70
**** total 10 60 70
july 40 20 60
**** total 50 80 130
aug 30 50 80
**** total 80 130 210
One idea I got is to write a script on each row rendering event and save the running totals to a global variables and after completing the rendering of the row output the cumulative totals, but I could not find a documentation about how to add a row dynamically.
Any help would be great.
Thanks,
sraoj
Find more posts tagged with
Comments
mwilliams
Hi sraoj,
Are you just doing this in a table? Also, what is the need for creating the row dynamically? Could you just add the row in your design and use your global variables to figure the running total and put them in data elements or dynamic text boxes. Another idea, if your dataSet is set up to do so, would be to create computed columns for running sums of each of your three existing columns and use those values in your table.
sraoj
Hi Michael,
Thank you for your reply. The first idea you mentioned looks like something that can be pursued, the second one is not. The data that comes is not as simple as I presented rather it comes from joining several tables so I don't know how to come up with an sql that will have the cumulative running totals of the rows.
Regarding the first idea can you explain it little bit more, like how to make the dynamic text repeat after each row.
Thanks,
sraoj
mwilliams
sraoj,
Do you know how many attributes there will be each time? With the way your data is in the dataSet, it may be hard to get your exact setup you're wanting.