The IF function allows you to test if a condition is either true or false by making a logical comparison. With the if statement the outcome of a field changes based on the condition.
IF(Condition, value if the value is true, value if the condition is not true)
But what if you need to test multiple conditions, where let’s say all conditions need to be True or False (AND), or only one condition (of multiple) needs to be True or False (OR). This can be done in Omnia as well.
For OR you can use two pipe symbols: ||
For AND you can use two & symbols: &&
Let's say you sell Lego stones and want to assign a string 'Primary color' to all products that have the color yellow, red or blue based on the import field [Color]. In this case the products can have only one color.
So the lego stones can be either red, yellow or blue, but should not be assigned 'Primary color' if it's another color than those three colors. The formula for this would be:
If([Color]='red'|| [Color]= 'yellow' || [Color]= 'blue', 'Primary color', 'Other color')
Let's say that you would like to make a report and want to mark your top products for the brand 'Lego' with the string 'Top product'. You have set the line on 50 units sold over the last 4 weeks. In this case, you only want to mark the products that have the brand 'Lego' AND have been sold more than 50 times in the last 4 weeks. The formula for this would be:
If ([Brand]='Lego' && [# Omni-channel Unit(s) sold last 4 weeks] > 50, 'Top product', 'Regular product')