Is there a way that I can calculate the division of the two formulas containing a shared numbervar with grouping condition?

50 Views Asked by At

I'm making a custom report, and there is a formulas to display the results of the division by group.

What I'm expecting is like,

| Area Manager | A/30=B | Total Age | Total DD |

| Peter | 654.000 | 123.000 | 5.31 |
| Peter | 653.000 | 122.000 | 5.35 |
| Peter | 652.000 | 121.000 | 5.38 |

The report uses grouping by Area manager. so total DD is obtained from sum (A/30=b by area manager) divided by sum (age by area manager). The Age column is using subreport, the rest is in main report.

What i've got is error "division by zero"

And here is my formula in main report

A/30=b
{@Rev+Ppn}/30

here is formula inside the subreport

Whileprintingrecords;
shared numbervar amt_ar:= amt_ar + Sum ({@amtagetotal}, {pmproj_seed.PROJECT})

So, the A/30=b and subreport I put it in group footer, and I save the shared numbervar into a variable in another file.

So, I created a new file to calculate the variable, and this is how it looks like

whileprintingrecords;
numbervar amtdd;         // variable to display dd
numbervar a30;           // variable to display a/30=b
shared numbervar amt_ar; // variable to display Age

amtdd:=a30/amt_ar;

EDIT

So, I've tried displaying the amt_ar variable and I put it in to the group footer and it worked. the sum is correct based on the group. and this is the formula named gf_amt_ar

Whileprintingrecords;
Shared numbervar amt_ar;

Here's my report design looks like Here's my report design looks like

Total AR is Total Age, and the subreport is in GF3

result Total DD is 0,00. All I want is "the 2 blue amount" is divided and display by group in Total DD column

0

There are 0 best solutions below