January 22, 200520 yr Hello, An apparent simple thing causes me some headache; I have following 3 fields: "COST", "DISCOUNT" and "DISCOUNT IN %" I want to either enter a $$ amount into field "DISCOUNT" and then get the percentage result of that $$amount related to "COST", OR enter a % amount into field "DISCOUNT IN %" and then receive the $$ amount in field "DISCOUNT". What I did: enter calc for "DISCOUNT" = ("COST" * "DISCOUNT IN %") ./.100 and enter calc for "DISCOUNT IN %" = ("DISCOUNT" ./. "COST")*100 When I do this I get the message that this would cause a circular definition after I enter the second calculation. Is there any way around this? Thanks, Andy
January 24, 200520 yr The easiest fix is to have two sets of fields and then stack them. Have two regular number fields for discount and Discount In %, and then two calculated display fields cDiscount and cDiscount In % calc for "cDISCOUNT" = case(isempty(DISCOUNT), (COST * DISCOUNT IN %) /100, DISCOUNT) calc for "cDISCOUNT IN %" = case(isempty(DISCOUNT IN %)(DISCOUNT / COST)*100,DISCOUNT IN %) Set the field options for the calculated fields to NOT allow entry, and then stack the calculated fields over top of the entry fields. The display fields will show the calculated value, but when you click on them you will actually be entering/editing data in the entry field underneath.
Create an account or sign in to comment