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!

subtracting a value from its previous value per jobcode going forever

Status
Not open for further replies.

DJWheezyWeez

Technical User
Jun 5, 2008
265
US
I made a thread on this issue before (thread767-1487850) and I got a great answer. When I made that thread, I was under the impression that we would only ever have Run#'s 1 through 5. Now I've been told that Run#'s never stop increasing. There is a new Run# each month. My question, in reference to my other thread, is there a way to make this work without needing to make new formulas for the new Run#'s every month?

I'm using CR XI.

-DJWW


 
It's been 4 days since I started this thread. If this is impossible to do, please let me know so I can stop obsessing about trying to figure out a way around this.

Thanks.
 
If the basic idea is the same then perhaps you can alter your approach to it and use appropriate grouping and ordering to not then limit by a particular number.

As I understand it the basic jist is what you are saying here:

....'I need to subtract the current value from JUST the previous one, not all the previous ones. So if there's a value for Run#s 3, 4, and 5, 3 will show its own value since there's nothing before it, 4 should be its value minus the value from 3, and 5 should be its value minus the original value from 4, not the formulated value of 4 minus 3. And this is only if they share the same JobCode. That part is all worked out though thanks to Madawc...'

Surely if you are grouping by JobCode and then grouping within that by Run# then you ought be able to perform these calculations without the restriction or formulae for each specific Run #?

Something like:

if {PV_JobWIP.RunNumber} = minimum({PV_JobWIP.JobCode},{PV_JobWIP.RunNumber})
then
sum(minimum({PV_JobWIP.JobCode},{PV_JobWIP.RunNumber}),{PV_JobWIP.MatVarValue})
else
sum({PV_JobWIP.RunNumber},{PV_JobWIP.MatVarValue})-
sum(previous({PV_JobWIP.RunNumber}),{PV_JobWIP.MatVarValue})

I'll sling some test figures together and test the logic later on.

Some sample data may help though. LBass has a point in that the current approach is very unweildy and cubersome when it doesn't need to be.

'J
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top