I am getting null for some of the rows in Amazon Athena when the absolute difference is bigger than 20 percent. I am not sure I understand the logic of why. Can someone explain?
case
when gla_sqft = AreaBuilding then 0
when ((abs(AreaBuilding- gla_sqft)/gla_sqft) > 0.2) then 1 else null
end as percent_diff_logic
AreaBuilding | gla_sqft | percent_diff | percent_diff_logic |
---|---|---|---|
1498 | 2100 | 0.2866666666666667 |