Jump to content
Sign in to follow this  
millmaine

calculation vs calculated value

Recommended Posts

I have a field which shows the Total Cost of a number of items. I also have a field to show the Total Value of the items. The Total Cost field is a calculation field. The Total Value field is a number field for the operator to complete.

What I would like to do is have the default Total Value = Total Cost, while allowing it to be overwritten by the operator.

If I make the Total Value field a Calculation field then it can't be overwritten by the operator

If I make it a Number field with an auto-enter calculation saying =Total Cost it just doesn't seem to work.

I've tried GetField. I've tried creating a second occurrence of the table and using Lookup.

It seems as though it should be simple but I'm bamboozled.

Share this post


Link to post
Share on other sites

the auto enter field should uncheck the box that overwrites existing contents.

Your calculation should be:

Case ( isEmpty ( self ) ; Total Cost ; self )

This way if the field is EMPTY then it uses the total cost field - but as soon as you enter a value in to the field then it uses its own contents.

Share this post


Link to post
Share on other sites

I had thought this worked but there is still the issue that calculated value just doesn't seem to calculate.

Share this post


Link to post
Share on other sites

Actually, it's a bit odd.

If I enter a value in the Value field, then delete it, the default value appears. In other words it enters the calculated value.

However if I do nothing the field remains blank. The whole point is to have the default value appearing without anything being done.

Any further thoughts?

Share this post


Link to post
Share on other sites

You may consider this:

TotalValue a number field users can enter to Overwrite the TotalCost calculation.

TotalCost = Case ( not IsEmpty ( TotalValue ) ; Sum ( your_other_fields ) ; TotalValue )

Then using conditional formatting you can determine if the field TotalValue is empty by using some color fill or font.

If you stack your fields so that the TotalCost is stacked on top of the TotalValue and only the TotalValue is allowed

to click into when in browse mode.

OR you can use another field format it as a checkbox with a 1 value - and use that as the basis for an Over ride

Then you enter the Value but it's not used unless you also check the checkbox.

Share this post


Link to post
Share on other sites

A variation on that works nicely. Thanks. Stacked fields has always felt a bit like cheating — but it's a good cheat!

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

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