cancel
Showing results for 
Search instead for 
Did you mean: 

If within mapper

matt_bostrom
New Contributor II

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.

2 REPLIES 2

del
Contributor III

try
$inventory != 0 ? $period_revenue/$inventory : 0

matt_bostrom
New Contributor II

ah wonderful that did the trick! i forgot about the question mark.