Creating Conditions Within Formulas

You can write conditional, or 'If', statements in your formulas pretty easily in Allmoxy.

Here's an example:

attribute_name == (formula) ? (formula if true) : (formula if false)

So, this is saying if attribute_name is equal to this (formula) use the (formula if true). If it is not equal, use (formula if false).

You can use other comparisons like < (less than), > (greater than), <= (less than or equal to), >= (greater than or equal to) or != (not equal to).

Also, you can chain together multiple conditions using && (and, both statements must be true) and || (or, either condition can be true). Here's an example of that:

attribute_name == (formula) && attribute_name < (other formula) ? (formula if true) : (formula if false)


Here's a real-life example being used on just one pricing section of an arched valance:

((height*width)/144)  > 3.5?
(((height*width)/144)-3.5)*wood_type.oversize_price_bf
: 0

This example is saying "if the square footage is more than 3.5 then give me that square footage amount multiplied by my oversized multiplier, otherwise just give me $0 for this section"

Also, when using nested IF Statements (aka when you're running multiple conditions into one pricing section) there is a specific way you should structure the formula to get it to work. You will want to open each line with a parenthesis and then close off all of them at the end (make sure you have an equal amount of closing parenthesis as you do opening parenthesis).

Here's an example of that:

(drawer_box_height > 3 ? 3 :

(drawer_box_height > 4 ? 4: 

(drawer_box_height > 5 ? 5: 

(drawer_box_height > 6 ? 6: 

(drawer_box_height > 7 ? 7:

(drawer_box_height > 8 ? 8:

(drawer_box_height > 9 ? 9:

(drawer_box_height > 10.25 ? 10.25))))))))

You can also add comments to your part formulas now just like you've been able to do in your pricing formulas. Add a comment anywhere in a formula for your own notes by surrounding the comment with a star and forward slash, like so:

/*this is a comment*/

Need more help? 

You can open up the "More Help" menu at the top of most formula-driven pages to find additional examples! 

image.thumb.png.636b1613988167b09184936413485e6e.png