Calculating percentage in footer of two other variables
I have 2 variables (TotProstate, TotNonProstate) in a group footer that
accumulate totals based on variables in the detail band (isProstate,
isNotProstate). I am trying to calculate what the percentage TotProstate is
compared to the total of both (TotProstate, TotNonProstate). Here is what I
am trying to do:
Value:= (TotProstate / (TotProstate + TotNotProstate)) * 100
However, I am ending up with 0%, even though the TotProstate and
TotNotProstate clearly have values the print in the group footer.
I am using a CalcType of veDataPipelineTraversal for everything, reseting on
veGroupEnd. This is with ReportBuilder 10.09. Any ideas?
accumulate totals based on variables in the detail band (isProstate,
isNotProstate). I am trying to calculate what the percentage TotProstate is
compared to the total of both (TotProstate, TotNonProstate). Here is what I
am trying to do:
Value:= (TotProstate / (TotProstate + TotNotProstate)) * 100
However, I am ending up with 0%, even though the TotProstate and
TotNotProstate clearly have values the print in the group footer.
I am using a CalcType of veDataPipelineTraversal for everything, reseting on
veGroupEnd. This is with ReportBuilder 10.09. Any ideas?
This discussion has been closed.
Comments
The problem is most likely the calc order in which the variables are
calculated. You need to be sure the TotProstate and TotNotProstate
variables are calculated before you try to use their values in another
calculation. You can alter the calc order by selecting "Calc Order" from
the band popup menu (right click).
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Variables (and also before just to look for a solution), but the results
remain at 0.. Any other thoughts?
Thanks,
Tim
In my quick testing with the DBDEMOS database and RB 11.07, this worked as
expected.
http://www.digital-metaphors.com/tips/VariableCalculations.zip
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
If not, I'll check the demo to see what is different..
Thanks,
Tim
VariableCaculations and noticed that the variables were referenced by
"variable.value" not just "variable". I made that change and the variable
worked correctly. Thanks for your help..
Tim