rpmel
Technical User
- Jan 8, 2009
- 9
I've created a report to calculate suggested stock holding:
Using the following example:
Part Number ABC123
Leadtime (Days) = 5
Buffer Stock (Days) = 2
Sales per Day = 1
Formula Field setup as follows:
Sales x Leadtime + Bufferstock (1 x 5 + 2 = 7)
I'm getting 29!!! Here's why: My report is grouped on Part Number and a SUM setup in the group footer. The formula is adding the Buffer stock in for EACH detail line - I only want to add it once!
I came up with the following:
But of course, the SUM function doesn't work because of the order in which Crystal processes things.....I think I need to use variables? Not really sure how to do this one?
Any thoughts?
Using the following example:
Part Number ABC123
Leadtime (Days) = 5
Buffer Stock (Days) = 2
Sales per Day = 1
Formula Field setup as follows:
Sales x Leadtime + Bufferstock (1 x 5 + 2 = 7)
I'm getting 29!!! Here's why: My report is grouped on Part Number and a SUM setup in the group footer. The formula is adding the Buffer stock in for EACH detail line - I only want to add it once!
I came up with the following:
Code:
If Previous ({ICSTATI.ITEMNO}) <> {ICSTATI.ITEMNO} Then
({@SLSWK} / 5) * ({?Leadtime}) + ({?Buffer Stock (Days)}) Else
({@SLSWK} / 5) * ({?Leadtime})
But of course, the SUM function doesn't work because of the order in which Crystal processes things.....I think I need to use variables? Not really sure how to do this one?
Any thoughts?