Newb calculation help
Hi there!
I am working on a mileage reimbursement form. I am trying to use an IF statement in a calculation field. I want the calculation to be IF the type of transportation is gas, then do a calculation. If it is not gas, then do a different type of calculation. This is what I have so far:
if (@Type of Transportation = "Gas") { @Miles * .52} else {@Total Cost of Item 1 + @Total Cost of Item 2 + @Total Cost of Item 3 + @Total Cost of Item 4 + @Total Cost of Item 5 + @Total Cost of Item 6}
The beginning part (before the else) works great. However, it does not perform the second calculation if the Type of transportation is not "gas". It simply returns a 0 no matter what is in the item cost fields.
Any help or advice as a new Podio user would be appreciated.
-
Hi RIck,
"equal" in a comparison needs 2 ==;var result = 0;
if (@Type of Transportation == "Gas") {
result = @Miles * .52;
} else {
result = @Total Cost of Item 1 + @Total Cost of Item 2 + @Total Cost of Item 3 + @Total Cost of Item 4 + @Total Cost of Item 5 + @Total Cost of Item 6;
}
result
Please sign in to leave a comment.
Comments
1 comment