Solved

Can i store a formula value in crystal reports

Posted on 2011-09-20
8
221 Views
Last Modified: 2012-05-12
I have the result of formula in a group footer.  Can I take that result and store that value then go back up to the details and reevaluate the number?  When I try it now it just reevaluates the formula for every line when I want it to just use the value from the first result.
0
Comment
Question by:WTIAutomation
8 Comments
 
LVL 4

Assisted Solution

by:musalman
musalman earned 41 total points
Comment Utility
Yes it will behave like this.
It is better if u calculate the footer value in sql and then use that value in detail
0
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
What is the formula in the footer?

If the formula is the right kind it may be possible to do what you want or you could insert a subreport in the group header to get the value then use it in the detail section

mlmcc
0
 

Author Comment

by:WTIAutomation
Comment Utility
Mimcc,
Its a formula you wrote for for the report we we're working on the last several weeks.  Its the mean in that report.  When I run the mean, i need to the take that value of mean in the group footer store that value and the reevaluate the lines in the details section using that value in another formula.    

Reference:
http://www.experts-exchange.com/Database/Reporting_/Crystal_Reports/Q_27285200.html

0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:WTIAutomation
Comment Utility
Just to give you the latest idea of whats going on, here is a fresh version of the report with data.  What I'm trying to do is compare the {recommenedStockQTY} field against the {TrxQTY} of every line and then mark it with a 1 or 0.  Count the 1s and then divide that by the total number of transactions.  What this will do is give me a percent of coverage, allowing me to judge then restocking quantities.  

 Inventory-for-Stock-production-r.rpt
0
 
LVL 34

Accepted Solution

by:
James0628 earned 43 total points
Comment Utility
I haven't tried to analyze it fully, but I don't think you can do what you want in that report.  recommendedQTYStock uses a formula that uses a formula that uses variables, which are set in a formula that uses {NVTTRX.TRX_DATE} - next({NVTTRX.TRX_DATE}).  Because of that, I don't think you can use one of CR's built-in summary functions, and the variables won't have the final values for the group until the report has read the last record for the group, meaning that you won't be able to see the final value for the group when reading the detail records.

 The obvious answer would be to use a subreport in the group header to get the value for recommendedQTYStock for each group.  Then you could check that in the details.  Another option might be to create a manual query that calculated recommendedQTYStock, so that it was included in the data that the report read (so CR wouldn't have to calculate it).

 Since mlmcc worked with you on the previous question, maybe he'll will have some other insights.

 James
0
 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 41 total points
Comment Utility
I just looked at in some detail.  I agree with James.  You could use a subreport to calculate the recommendedQTYStock value and pass it back in a shared variable.

Other than that idea, I don't think it is possible to use the value.

mlmcc
0
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 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

15 Experts available now in Live!

Get 1:1 Help Now