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

Make formula act like running total

Status
Not open for further replies.

thebigbadwolf

Programmer
Jul 7, 2010
67
CY
Hello everyone,
i am using CR9 and i am working on a report that has 200 or more formulas.
The thing is that i have done a serious mistake and i should have used running totals...

so, is there a way i can alter a little bit the formulas so they can act like running totals?
The formulas are like:
if isnull({VCR_WORK_ORDER.VWOWO_JOB_REQUEST}) and
date({VCR_WORK_ORDER.VWOWO_END_DATE}) in {?from:} to {?to:} and
month({VCR_WORK_ORDER.VWOWO_REPORT_DATE})=4 and
month({VCR_WORK_ORDER.VWOWO_END_DATE})=5
then count ({VCR_WORK_ORDER.VWOWO_CODE})

when they should be running totals counting the {VCR_WORK_ORDER.VWOWO_CODE} field and in the evaluate formula, i should have placed the previous formula:

isnull({VCR_WORK_ORDER.VWOWO_JOB_REQUEST}) and
date({VCR_WORK_ORDER.VWOWO_END_DATE}) in {?from:} to {?to:} and
month({VCR_WORK_ORDER.VWOWO_REPORT_DATE})=4 and
month({VCR_WORK_ORDER.VWOWO_END_DATE})=5


any advice would be highly appreciated!!!
 
YOu can use

If
isnull({VCR_WORK_ORDER.VWOWO_JOB_REQUEST}) and
date({VCR_WORK_ORDER.VWOWO_END_DATE}) in {?from:} to {?to:} and
month({VCR_WORK_ORDER.VWOWO_REPORT_DATE})=4 and
month({VCR_WORK_ORDER.VWOWO_END_DATE})=5
then 1 else 0

Then summarise this formula at Group or Report level, a simple sum will yield a Conditional count

Ian

 
Quick response!thanks Ian, of course it works (great idea!) but it would maybe slow down the report and it would take too much time for me to place all 200 sums into place! (i use only the report footer in this report btw)

How about just placing something in the report and All of a sudden, in a magical way :), the report starts working?
maybe changing the control structure (if then else) with something different?
something that doesn't make me to change the way i created the design of the report...
 
Sorry can't think of anything magical, you are using a summary in a formula which is looking at a single record. Thus if the last record meets the condition you see a result if not then nothing.

Looks like a boring update process.

I have not used it but .rpt inspector advertised above is meant to be able to speed up process of mass updating formulae.

Ian
 
If all the formulas use these criteria, why not just add them to the selection formula instead? Ian's solution is actually more efficient than using running totals, by the way.

You also have redundant criteria where you are checking for the month of the end date and also setting an acceptable range.

-LB
 
I have already changed the report (deleted the formulas and replaced them with running totals).
It surprises me that summaries are more efficient than running totals but, maybe, it would be more easy to read..
formulas doesn't use same criteria though, (i have placed some criteria in the select expert section) and it looks like i have redundant criteria but that's not correct.
The customer liked it that way (12X24 running totals) with months etc.. anyway!

Thanks again for your help! Great forum btw!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top