Thanks Cor :-)
I want to get the grand total (sum) of one column (not row) Then I need to take that grand total and divide each row of the column by the grand total in order to get percentage rate. This is done In MS Excel as:
Column A Column B
row 1 100 =100/600 (Column A Row 1/Column A Total)
row 2 200 =200/600 (Column A Row 1/Column A Total)
row 3 300 =300/600 (Column A Row 1/Column A Total)
Total 600
I need to get the value of "600" into a variable that I can use to divide each row for column A by. Does that Make a little more sense? I ended up creating two datagrids. One that does all the calculations up to the grand total that I need (column A) and I created a variable to store the total for Column A "600" in after I did the databind on the first datagrid. In the second datagrid I took the grand total from Column A "600" and used it in my second datagrid to divide the values from each row in Column A with. Since each row in column A has a variable associated with it (I know there will always be 17 rows of data) I created 17 separate variables for each row in datagrid 1 and use those variables divided by the grand total (Total Column A - "600") from datagrid 1 as available in datagrid 2. Now I hide both datagrids and populate an html table with the values from datagrid1 and datagrid 2 to display to the user. Not simple, not pretty, but it works.
If there is an easier way to get percentage rates from a calculated value for each row, I'd love to know about it...
Thanks - I hope you understand what I was trying to do. This type of calculation is EXTREMELY easy in Excel, but when you have to do all the work that Excel does for you automatically, it is VERY difficult.
Coleen
"Cor Ligthert" <(E-Mail Removed)> wrote in message news:e1w7$(E-Mail Removed)...
>
> Coleen,
>
> I am really confused by you, do you want a "compute" the sum of a vertical
> column or an expression to get the sum of horizontal items in a rows?
>
> Datatable.Compute
> http://msdn.microsoft.com/library/de...mputetopic.asp
>
> And what you are using in my opinion.
> Datacolumn.Expression
> http://msdn.microsoft.com/library/de...ssiontopic.asp
>
> What is it you want?
>
> Cor
>
>
>
> Cor
>
>