on 03-12-2014 10:32 PM
Hi
I have had help with a crosstab to create a calculated member column that sums values from selected columns in the crosstab. The column is called Sum of Conv (see example below)
I would like to create another column to the right hand side of the Sum of Conv column which calculates the percentage converted ie ( the Sum of Conv value divided by the Grand Total value) x 100. This will replicate the calculation currently in the crosstab on a per month basis but as an overall conversion rate for the period selected.
How should I reference these values in a new calculated member? Or will I need another calculation formula in the new calculated member which calculates the Sum of Conv value again to then divide by the Grand Total value?
Thanks
Jon
Hi Jon,
Here's what you need to do:
1) Right-click the header cell of the column 'Sum of Conv' > Calculated Member > Edit Column Value formula > Type in this code:
Cdate(1890,1,1)
2) Right-click the same header cell > Calculated Member > Insert Column. A new blank column is inserted beside this column.
3) Modify the Calculation Formula for the 'Sum of Conv' formula to:
local numbervar i;
local numbervar summ;
For i := 4 to GetNumColumns Step 4 do
(
if gridlabelat("@SO_Conv", i) = "Conv" then
summ := summ + tonumber(GridValueAt(currentRowIndex,i,CurrentSummaryIndex));
);
summ;
4) Right-click one of the zero values (embedded summaries) in the newly added columns > Calculated Member > Edit Calculation formula and use this code:
(GridValueAt(CurrentRowIndex, CurrentColumnindex -1, CurrentSummaryindex)/GetTotalValueFor("My_Date_Field", CurrentSummaryIndex)) * 100
Replace "My_Date_Field" with the database field name that you've used as the first column in the crosstab. Make sure the double-quotes stay as above.
Hope this helps.
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abhilash,
Thank you for your help.
I did the above but the change to the Calculation formula for "Sum of Conv" resulted in zeros.
I changed this formula back to the previous version (ie For i = 3 etc) & this returned the expected values.
Other than that one query your solution above has done exactly what I needed.
Thank you again for your prompt reply & help.
Thanks
Jon
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.