The total field has no value

Hello, I am trying to calculate the total quantity for 3 sites. MBA2 and ZYZ1 are fine because they all have values in each process i am trying to add up (IB,OB,PS,PC). However, PRG5 doesn’t give me a total and returns blank because it doesn’t have PS & PC quantity and so returns no values in total. I used a calculated field to get the totals using the query below;

({IB Quantity}+{OB Quantity}+{PS Quantity}+{PC Quantity })

image

Try using ifelse: like if value is null return 0 and then add all the fields.

( ifelse(isNull(IB Quantity}), 0 , {IB Quantity})+
ifelse(isNull(OB Quantity}), 0 , {OB Quantity})+
ifelse(isNull(PS Quantity}), 0 , {PS Quantity})+
ifelse(isNull(PC Quantity}), 0 , {PC Quantity})+ )

2 Likes