Hello -
I’m trying to create a conditional statement for an equation type field. According to this article Conditional Equations I should be able to create the following equation that evaluates total amount owing depending if fees have been paid. If a date has been entered into the Fees Date Paid column, then ignore the the amount paid, otherwise include Fees in the calculation.
{Fees Date Paid} > 0 ? ({Total Price} * {Inventory}) : ({Total Price} * {Inventory}) - {Fees}
However, when I enter this, it doesn’t save. The calculation reverts to what was entered in the field before (I’m trying to update it to include this conditional logic).
Any help on how I can achieve this? Thanks.
Just off the top of my head, and without trying it out. It may be that you’re trying to see if a date is >0. I don’t think this would work with a date field. You may have to add an equation field to convert the date to a number and you should then be able to check if the value is higher than zero.
1 Like
Thanks @CarlHolmes. According to that article, Knack will consider a blank date field as 0 (there is no “is blank” or “is not blank” concept apparently with Knack). So checking if greater than 0 seemed to make sense. However, it turns out that spacing was an issue. I managed to get my conditional logic to work by removing all spacing between operators. So {Fees Date Paid}<>0?({Total Price}*{Inventory}…etc and it all works.
2 Likes
Excellent….equations can be a bit tricky
Looks like my initial thoughts were wrong on this one. Well done for getting to the bottom of it