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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sum(Top 25) / Sum(All) = ZERO, why???

Status
Not open for further replies.

pandpp

Programmer
Sep 17, 2003
110
0
0
AU
This report pulls out all records in a set. Only the top 25 of those is to be displayed.

All of that is working fine.

What I need on top of that is the percentage of
Sum(Top 25) / Sum(All)

To get the Top 25, I have a ranking field from the Universe. When that is > 25, I merely assign a value of zero, otherwise the value I want to sum.

Not sure if it's making ANY difference, but, there are 5 sections in the report.

In GF5 I can see Sum(All) & Sum(Top 25), all perfectly, both as a total, as well as a variable.

Now, when I create a variable that is nothing more than Sum(Top 25, GF5) / Sum(All, GF5) I get a value returned of 0.0000.

I thought maybe it was something to do with the numbers, so I manually created a variable with the values of Sum(Top 25) & Sum(All) in it & the result is correct, 0.18 in this case, or 18%.

I'm at a loss on this & would appreciate a little direction if anyone has some thoughts.

This is being developed in Crystal 2008 on an XIR3 Universe against SQL Server 2005.

Thanks,

Peter.
 
Please show the contents of the formulas you are using (including nested formulas) and indicate indicate the report section in which each are placed.

-LB
 
LB,

I have @varTop25$:

If {BillabongDataWarehousev0001_query.Customer Rank (by Base Line Value) Top 25} <= 25 Then
{BillabongDataWarehousev0001_query.Base Line Value}
Else
0

and that's in the Detail section.

{BillabongDataWarehousev0001_query.Customer Rank (by Base Line Value) Top 25} returns a value starting at 1 & going up, giving the ranking of eack product based on sales, used for ordering & selecting the top 25.

In GF5 I then have a formula:

Sum ({@varTop25$}, {BillabongDataWarehousev0001_query.Product Group Description})/Sum ({BillabongDataWarehousev0001_query.Base Line Value}, {BillabongDataWarehousev0001_query.Product Group Description})

Group5 is {BillabongDataWarehousev0001_query.Product Group Description})

What I get is Sum ({@varTop25$}, {BillabongDataWarehousev0001_query.Product Group Description}) gives me a value, say 1,

and Sum ({BillabongDataWarehousev0001_query.Base Line Value}, {BillabongDataWarehousev0001_query.Product Group Description}) gives me another value, say 4,

but Sum ({@varTop25$}, {BillabongDataWarehousev0001_query.Product Group Description})/Sum ({BillabongDataWarehousev0001_query.Base Line Value}, {BillabongDataWarehousev0001_query.Product Group Description}) gives me 0 and not 0.25.

Each of these values (1, 4 & 0) are returned in GF5.

There's not a great deal to it.

Thanks for your help, second time in 2 days.

Peter.
 
Well, did you increase the decimals to see whether this is just the .25 displayed as zero because its not formatted to show the decimals?

-LB
 
Yes LB, hence why I pointed out that my answer was coming back as 0.0000, I pushed it out to 4 dp.

Peter.
 
Sorry, I didn't see that. If your formulas are exactly as shown, then I can't think of any reason why the result would not appear as .25. The only thing I can think of where you could FORCE a zero to appear regardless of the actual value is if you used field formatting->display string and then set it to display zero under certain circumstance--but if you are the report developer you would know if you'd done that.

Maybe check with SAP/Business Objects. I recently had a situation where charts were displaying scientific notation on the y-axis--but only for one user, and it turned out that it was caused by a service pack. Maybe this is some kind of known bug.

-LB
 
Thanks LB.

I'll check with SAP. To me, there is NO reason at all, so, hopefully it is nothing more than a wee feature.

Peter.
 
I got back to this report & fixed it.

I used the format painter to format the result. Not sure what happened, but, the end result is it stuffed up. I put a new object on the page & the correct result was displayed.

Thanks LB for the time spent on trying to fix a problem that turned out to not exist.

Peter.
 
I'm glad to know this was resolved.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top