3 Replies Latest reply: Oct 23, 2018 11:04 AM by Sunny Talwar RSS

    If statement not working correctly???

    Jerry Ile



      I have an if statement in a table measure that calculates a shipping weight against a shipping cost from a variable


      It seems to work in the table although it doesn't show a total

      If(Transport = 'S',

      (vShipCost / (1/KG)) * sum(Qty),

      If(Transport = 'A',

      (vAirCost / (1/KG)) * sum(Qty),

      (vLandCost / (1/KG)) * sum(Qty)))


      Also if I put it in a KPI and minus By Sea to show the amount lost by Air shipment, it ignores the transport and multiplys everything by Air


      vShipCost = .60

      vAirCost = 2.95


      QtyFreight ChargeBy SeaDifference

      Note By sea field has (vShipCost / (1/KG)) * sum(Qty) and shows a total but Freight Charge using the if statement above doesn't show total



      Can you please advise on how to correct the if statement for the table and KPI