03-06-2018 02:48 PM
i’ve seen this before just cannot remember the syntax. how can i do an IF within a mapper? i want to say that if the $inventory != 0 then perform $period_revenue / $inventory = $price_per_unit other wise price_per_unit = 0
i’ve seen something like a switch statement before like $inventory != 0 : $period_revenue / $inventory but cannot remember the exact syntax.
03-06-2018 02:52 PM
try
$inventory != 0 ? $period_revenue/$inventory : 0
03-06-2018 02:54 PM
ah wonderful that did the trick! i forgot about the question mark.