I am using CR XI to query a DB2 database. Currently I have two tables pulled into the report.
1) DR_PROD_HISTORY
2) SERVICE_CODE
These tables are linked via inner join between these three fields 1) ORG_CODE 2)PROCEDURE_CODE and 3)PROCEDURE_MOD. I have three groups set up currently in the report.
The first group is on DRPRODHISTORY.monthend_date, the second grouping is by procedure code and the third grouping is from the Service Code table. This group is based on a formula whereby different components are displayed as Global, Technical and Professional. The Technical and Professional Component fees comprise the Global fee.
Essentially what I need to do is to create a percentage by diving the global component into the techical component fee and with that figure what amount of the global component dollar value goes to the technical component aspect. I've created two formulas to identify both the global and technical components which look like this:
if GroupName ({@components}) = "Global Component" then {SERVICE_CODE.STANDARD_AMT} and
if GroupName ({@components}) = "Technical Component" then {SERVICE_CODE.STANDARD_AMT}
with these I've attempted to create a variable to place in group footer number three that looks like this:
whileprintingrecords;
numbervar tech_percent := ({@global} / {@tech}) * {@net_charges}
I place this in GF3 and when I run the report I get a division by zero error. The formula picks up the global value and the net charges value but will not pick up the tech value or it's result is zero which prompts the error.
Obviously I'm on the wrong track somewhere I just can't figure out where. I'm feel as though using a variable is the way to accomplish what I need but apparently I'm going about it in the wrong manner.
Thanks in advance for any help.....
1) DR_PROD_HISTORY
2) SERVICE_CODE
These tables are linked via inner join between these three fields 1) ORG_CODE 2)PROCEDURE_CODE and 3)PROCEDURE_MOD. I have three groups set up currently in the report.
The first group is on DRPRODHISTORY.monthend_date, the second grouping is by procedure code and the third grouping is from the Service Code table. This group is based on a formula whereby different components are displayed as Global, Technical and Professional. The Technical and Professional Component fees comprise the Global fee.
Essentially what I need to do is to create a percentage by diving the global component into the techical component fee and with that figure what amount of the global component dollar value goes to the technical component aspect. I've created two formulas to identify both the global and technical components which look like this:
if GroupName ({@components}) = "Global Component" then {SERVICE_CODE.STANDARD_AMT} and
if GroupName ({@components}) = "Technical Component" then {SERVICE_CODE.STANDARD_AMT}
with these I've attempted to create a variable to place in group footer number three that looks like this:
whileprintingrecords;
numbervar tech_percent := ({@global} / {@tech}) * {@net_charges}
I place this in GF3 and when I run the report I get a division by zero error. The formula picks up the global value and the net charges value but will not pick up the tech value or it's result is zero which prompts the error.
Obviously I'm on the wrong track somewhere I just can't figure out where. I'm feel as though using a variable is the way to accomplish what I need but apparently I'm going about it in the wrong manner.
Thanks in advance for any help.....