Solved

Crystal Report 3 formula trick - calculation formula

Posted on 2011-09-28
6
1,092 Views
Last Modified: 2012-05-12

I am trying to complete a 3 formula trick to calcalate a grand total from a group total.

so far so good except I seem to have a road block in the calculation formula and get an error that a 'Number" is required here when I drop in my group total field to calculate.  I have tried to use a conversion to no avail.  And that field data type IS a number in the report.

See attached.

thanks

CR-3formtrick-number-required.jpg
0
Comment
Question by:BioTechManic
  • 3
  • 2
6 Comments
 
LVL 1

Expert Comment

by:gordon2011
Comment Utility
The problem is that according to your formula, you are trying to sum the Company name - which will cause an error. Unless I'm missing the point, if it's a grand total then you don't need to sum the group totals, just sum the individual field.

If you want to know the total at specific points, then try a running total.
0
 

Author Comment

by:BioTechManic
Comment Utility

Gotcha - That is what I figured...but have tried many variations on this.

Running total won't work on a summarized field in a group...I so wish it would - hence using the 3 formula trick - I am CR9 btw.

When I try to use the actual field amount, which is a currency datatype, I get the same error - see attached... Error
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 125 total points
Comment Utility
I would guess that Activity.Amount is a currency.

Try this

WhilePrintingRecords;
Global CurrencyVar GrandTotal;
GrandTotal := GrandTotal + {Activity.Amount};


The other way would be to convert the amount

CDbl({Activity.Amount})

mlmcc
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
gordon2011 - Sum({Activity.Amount},{Name.Company})
That calculates the sum of Activity.Amount over the group for a company.
It limits the values in the sum to the records for the company.  Other wise it will sum all values in the report.

mlmcc
0
 

Author Comment

by:BioTechManic
Comment Utility
changing to Global CurrencyVar did it!! wow - I knew I was close - funny how it would not let me change the data type within the last statement on the calculation formula - I did have to go into all 3 formulas and change the GrandTotal variable datatype to currency and then I could put in the formula that calculated the group totals and wallah - it worked.

thanks

now I think I am supposed to do something with points...I dont do this often - once a year or so.....
0
 

Author Closing Comment

by:BioTechManic
Comment Utility
awesome - thanks
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This video discusses moving either the default database or any database to a new volume.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now