I have a report that requires 2 "tables". The first table summarizes total
lbs by a category and then provides a company total at the end:
cat 1 75
cat 2 100
cat 3 200
-
total 375
The second table needs to display the % of the total for each category:
cat 1 20%
cat 2 27%
cat 3 53%
-
total 100%
How can I reference the company total for doing the calculations for the
second table? I am working with Visual Studio 2003. My dataset pulls a
file from the AS400 using an sql statement.
Thank you, PB
You don't need to access the first table to pull the percent. Just build the first table and then copy it below or next to table_1. Then go into the expression of the sum of table_2 and change the formaula to formatpercent(.....) and you are done.
Since each table is pulling the same fields and calculating on the same set of data the tables they will always match. Just make sure to make equal changes on both tables.
Option 2:
I would recommend just adding another column next to the sum with the percent. This way you would only need one table.
|||The problem is that I don't know the company total until the end, or is there an expression that will let me calc the percent of the overall total? I'm kind of new to this and I don't know all the expressions/functions. Essentially, I need each category total/company total.
Also, I do agree that it would be better to just include the % as another column in the first table. These were originally Excel pivot tables that I have been asked to program using Vusual Studio.
Thank you .... PB
|||I figured out the answer. I needed to add company as the highest grouping level in my table. I then need to add a "scope" to my aggregate function. ex.
=sum( Fields!ASCURWK9.Value ) / sum( Fields!ASCURWK9.Value,"company_group" )
No comments:
Post a Comment