Tap Forms Database Pro for Mac, iPhone, iPad and Apple Watch › Forums › Using Tap Forms 5 › Using Checkmark Field
Tagged: Calculation, Checkmark
- This topic has 2 replies, 3 voices, and was last updated 10 years, 5 months ago by
1Levite.
-
AuthorPosts
-
June 28, 2015 at 2:21 AM #14107
Yvette MParticipantI’m sorry if this question has already been asked but I can’t find it and can’t use the examples I have found to work in my situation.
I have a form that is a log of items I’ve purchased. So far I keep a running total that is displayed in the list view by having my form calculation summary be that of the “subtotal” field.
I’d like to add a Checkmark field (or something) labeled “returned” so that if I returned the item the total would not contain that items price in my total summary.
So far I have a number field labeled “price” and a calculation field labeled “subtotal”. The formula is ([Price]*.081)+[Price])
I get the item price plus tax.I want to add the field “returned” and get the result I am looking for.
Please help. And sorry if it’s obvious but I can’t get it to work. Thanks!
Yvette
June 28, 2015 at 3:15 PM #14117
BrendanKeymasterHi Yvette,
The Checkmark field will be stored in the database as a 0 or a 1. So multiply your formula by your Checkmark field, then when the Checkmark field is OFF, the result will be 0 because anything multiplied by 0 is 0. When it’s ON, the result will be whatever the main part of your formula results in because a value multiplied by 1 results in that value.
Hope that makes sense.
Thanks,
Brendan
June 29, 2015 at 6:50 PM #14126
1LeviteParticipantI was working a similar formula for the weight of items added to, or not added to my backpack using the “if” statement. Had I thought about Brendan’s solution, that would have been the elegant solution. I used the inelegant “if” statement.
I was thinking that if you care about credits or something other than zero when “return” is checked, the “if” statement could be used, as in the following example:
if([returned],([price]*-0.081+[Price]*-1),([price]*0.081+[Price]))
If returned is checked/true: the formula gives a negative result equivalent to the price plus tax (a credit)
If returned is unchecked/false: the formula gives the price plus tax
-
AuthorPosts
You must be logged in to reply to this topic.