2 Replies Latest reply: Jun 15, 2018 10:12 AM by Thomas Williams RSS

    Subtraction

    Thomas Williams

      Hi,

       

      How do I right out a simple subtraction within a measure please?

       

      I have written this but doesn't seem to work as the value don't subtract correctly so I must be missing somthing within my formula

       

      sum(Total_new - [FLD.IN_TOTAL] - Total_Net)

        • Re: Subtraction
          Mark Ritter

          Have you confirmed that the expected data is in each of the 3 fields and that simply subtracting them gives you what you expect?

           

          I would display each field and then subtract the last two and then add the third field and see what results you get along the way to figure out where it is not working.

            • Re: Subtraction
              Thomas Williams

              Total_new = 17,076.50

              FLD.IN_TOTAL = 3857.56

              Total_Net = 7715.12


              My total using sum(Total_new - [FLD.IN_TOTAL] - Total_Net) = 18,723.56

              but it should be 5,504.22


              When I subtract Total_new = 17,076.50 - FLD.IN_TOTAL = 3857.56 I get the correct value of 13219.34


              So the variable total_new seems to add on it's value rather than subtract and I don't know why