
Re: Expression to divide one column by the total of another
Gysbert Wassenaar Feb 14, 2013 1:28 PM (in response to Chad Gambone)Try sum(Value2) / sum(total Value1)

Re: Expression to divide one column by the total of another
Chad Gambone Feb 14, 2013 1:31 PM (in response to Gysbert Wassenaar )This is just giving me 0 everywhere. Both value1 and value2 are expressions themselves, I should have mentioned that at the start. They aren't just fields.

Re: Expression to divide one column by the total of another
Chad Gambone Feb 14, 2013 2:00 PM (in response to Chad Gambone)This is a slightly simplified version of it. I need the LR column to all divide by the sum of EP, instead of the EP in that particular line.

PivotTableIssue.qvw 138.2 K

Re: Expression to divide one column by the total of another
Gysbert Wassenaar Feb 14, 2013 2:20 PM (in response to Chad Gambone)Ok, two simple sum expressions. You need the total keyword in the one you divide by;
=sum(if(DataType='Actual' and Measure = 'IncdLoss',Total,0))/sum(total if(DataType='Actual',EP,0))
Actually, you can rewrite your expressions so you don't have performance inhibiting if's:
sum({<DataType={'Actual'},Measure={'IncdLoss'}>} Total) / sum({<DataType={'Actual'}>} total EP)
See attached qvw

PivotTableIssue v2.qvw 139.2 K





Re: Expression to divide one column by the total of another
Jefferson Martins Feb 14, 2013 2:27 PM (in response to Chad Gambone)Hi chadgambone,
You need to use the expression as follow :
sum(Value2)/ sum(total Value1)
Hope this helps you.
Regards

test.qvw 149.8 K

Re: Expression to divide one column by the total of another
Jefferson Martins Feb 14, 2013 2:25 PM (in response to Jefferson Martins )
PivotTableIssue.qvw 140.5 K

Re: Expression to divide one column by the total of another
Satyajeet Pradhan Feb 14, 2013 3:23 PM (in response to Jefferson Martins )Try this expression for 'LR' column
=IL/(sum (total (if(DataType='Actual',EP,0))))
using the keyword 'total' will help


Re: Expression to divide one column by the total of another
Celambarasan Adhimulam Feb 14, 2013 3:14 PM (in response to Jefferson Martins )Hi,
Check the below expressions
Eprem: =Sum({<DataType={'Actual'}>} EP)
IL : =Sum({<DataType={'Actual'}, Measure={'IncdLoss'}>} [Total])
LR: =IL/Sum(TOTAL {<DataType={'Actual'}>} EP)
Hope it helps
Celambarasan


Re: Expression to divide one column by the total of another
Chad Gambone Feb 14, 2013 3:33 PM (in response to Chad Gambone)Thanks everyone. It took a little bit of finessing, but these techniques got it done.