Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7950 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi everybody,

I have a problem witch i can't seem to fix...I hope someone here can help me!

I have 5 loose fields with a purchase price (purchase price1, purchase price2, etc...etc) witch are populated and 5 loose fields with a sale price (sale price1, sale price2, etc...etc) witch are not populated. Next to those fields I have a total saleprice field witch must be higher/same than the sum of the 5 fields with the purchase price.

When I fill in the total sale price field, I want to run a script (or even a caculation in the 5 sale price fields) witch devides the total sale price over the 5 loose sale price fields. But the hard part is that the price that is devided in the loose sale price field may not be lower than the associated purchase price field. The fields are associated by purchase price 1 and sale price 1, purchase price 2 and sale price 2, etc...etc.

Can anybody help here? Please let me know when it is unclear what I'am writing!

greetz & thanx...Jeff

Posted

Do you want always want to divide the total-sales price equally on the 5 sales prices numbers (eg, 100 becomes 20+20+20+20+20) and then 'beep' if a salesprice is lower then the corresponding purchase-price, or do you want to make possible other divisions of that number 100 when there is a 'beep'?

The first thing is easy, the latter more difficult. Give an example of what should occur please.

In the first occasion, I think it is not to difficult to set up a field validation by calculation that prevents a total salesprice that is to low being entered.

Harryk

Posted

But the hard part is that the price that is devided in the loose sale price field may not be lower than the associated purchase price field.

A single Case calc here, but what should happen then ?

For the rest, validate by calc as Harryk said...

Posted

salePrice1=Max(total/5,purchasePrice1)

salePrice2=Max((total-purchasePrice1)/4,purchasePrice2)

salePrice3=Max((total-purchasePrice1-purchasePrice2)/3,purchasePrice3)

salePrice4=Max((total-purchasePrice1-purchasePrice2-purchasePrice3)/2,purchasePrice4)

salePrice5=Max(total-purchasePrice1-purchasePrice2-purchasePrice3-purchasePrice4,purchasePrice5)

Dj smirk.gif

This topic is 7950 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.