Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Footer VALUE into details section

Status
Not open for further replies.

msi30502

Technical User
May 9, 2012
30
US
Good Morning...I need help.

I have the following situation:

In my details section I have a column with 5 years the first year is counted as 0

X
0
1
2
3
4

The total number of years is 5 on the formula summary section in the footer.

then I need only the value of 5 to be used as a denominator in a subsequent formula back into the details section, we'll call it formula A.

So suppose in this case the numerator is 20, and the desired denominator is the number of years (in this case 5). Hence, 20/5 = 4 the new set of columns should read

X Y
0 4
1 4
2 4
3 4
4 4

However the problem lies in that when I go to insert the numerator/denominator formula,the program gets translates the X in the details section as the denominator and then gives me a message that it cannot divide Zero because X in the first year of the details is 0.

What I really need is to keep the denominator in the details section as the value presented in the footer back into the details formula, in this example it's 5. Of course the value of the denominator will change when I set the report with different parameter values.

Can anyone help?
I'm using Crystal 8.0

Thanks in advance.

 
You'll need to use either the Count or DistinctCount summary formulas to get the year count. You're final formula might look something like this:

If DistinctCount({MyTable.Year}) > 0 then
{MyTable.Value} / DistinctCount({MyTable.Year})
else 0

-Dell

DecisionFirst Technologies - Seven-time SAP BusinessObjects Solution Partner of the Year
 
Thanks for the reply, but that's not going to work.

I din't want to complicate things further, but the year numbers are derived from a number formula not from the database itself. They are actually formulas using global and shared variables. So, I wanted to simplify by just extracting the VALUE in the formula field containing 5 and inserting it into future formulas which would be inserted into the detail field.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top