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

Running total parameters

Status
Not open for further replies.

fedleo

Technical User
Oct 26, 2003
11
IT
I need to reset a running total when the total amount goes over a specific number if dayofweek=2 to 6 and another specific number if dayofweek=7.
At the same time the report must change the date of production adding one day...
Let me explain:

I'm producing some items on an order that will be relased for example on 10/10/03. On this working day I can use my lasercut for just 12 hours (43200 seconds) but the total amount of time is over this value, about 13 hours. So I need to reset my running total and then change the date of production adding a day (the next working day more precisely). The same if the day is a Saturday when I can work just 8 hours (28800 sec).
Beyond to this, I must reset the running total when the date of production normally changes.

Is a bit hard for me...

Thanks in advance,

Fedleo
 
Consider posting real techical information, such as version, example data and expected output.

Text descriptions are helpful, but without knowing your environment, and what your data looks like, it's very difficult to supply technical information.

-k
 
Dear synapsevampire,
you must consider that I'm not a programmer like you but just a novice programmer of CR. I understood you need more detailed info for help me and I'll try to be more precise as soon as I can.

Cheers,

Fedleo
 
Here's my problem running CR8.5 ITA:

For my business I need to order the report as follow:

{Date} {CNC} {Sheets} {Materials}

based on a tab composed by this fields

{Date} {CNC} {Sheets} {TIME} {Materials}

The fields are ordered under two groups: for {Materials} and then for {CNC}. After grouping I've add a subgroup order for MINIMUM ({Date},{Materials}). Then I created the formula @TEMPOSTD=({TIME}*{Sheets}) that is the time used for production espressed in seconds.
After that I created a running total {#RTotal0} for SUM(@TEMPOSTD) calculated on the variance of {CNC} and reset on MINIMUM ({Date},{Materials}).

At this point all works fine.

Now I need a new running total that is used in order to determine the total time used on a working day.
So: {#RTotal1} for SUM(@TEMPOSTD) calculated on the variance of {CNC}.

Here's an example:

{Date} {CNC} {Sheets} {Materials} @TEMPOSTD {#RTotal0} {#RTotal1}
10/10/03 000100 1 AISI3042B 15300 15300 15300
10/10/03 000200 3 AISI3042B 18800 34100 34100
10/10/03 000300 1 AISI3042B 9300 44100 43400

10/10/03 000400 1 AISI304F1 23300 23300 66700
10/10/03 000500 1 AISI304F1 13400 36700 80100

Here's the trouble becouse I must reset {#RTotal1} following a new formula based on if-then-else. I must consider various things like dayofweek command, {Date} field,and two specific totals amount of seconds for @TEMPOSTD. Hard to explain...

The first inportant parameter is the maximum total amount of seconds for {#RTotal1}.
Depending of the working day it change: if DAYOFWEEK=2 to 6 then time is 43200 sec (12 hours) and if DAYOFWEEK=7 (saturday) then time is 28800 (8 hours).

Then report result I need at this point is:

{Date} {CNC} {Sheets} {Materials} @TEMPOSTD {#RTotal0} {#RTotal1}
10/10/03 000100 1 AISI3042B 15300 15300 15300
10/10/03 000200 3 AISI3042B 18800 34100 34100
10/10/03 000300 1 AISI3042B 9300 44100 43400

10/10/03 000400 1 AISI304F1 23300 23300 23300 [reset here!]
10/10/03 000500 1 AISI304F1 13400 36700 36700

The reset is due by the total amount of @TEMPOSTD that is over 43200 and the dayofweek that is 6. So that's the condition:

IF {#RTotal1}=>43200 and DAYOFWEEK= 2 to 6 then {#RTotal1} and @RESET
IF {#RTotal1}=>28800 and DAYOFWEEK= 7 then {#RTotal1} and @RESET
else {#RTotal1}={#RTotal1}+@TEMPOSTD

Where @RESET is {#RTotal1}=0.

Beyond to this I must change the effective date of production adding a day (the next working day) on the {Date} field if possible.

Thanks to all.

Cheers,

Fedleo
 
You can't reset a running total using the value of the running total itself. You would have to recreate your running total using variables. Use the 3-Formula technique described in faq149-182.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Tips and Tricks / Guide to Crystal in VB
- tek@kenhamady.com
 
Hi Ken,
nice to meet you here too.

I'll try to modify my running total Monday morning. Thanks for your help.

Cheers,

Federico
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top