4 Replies Latest reply: Dec 14, 2011 7:28 AM by SEA_1970 RSS

    IF statement in expression

      Hi everybody,

       

      I have a question using a IF statement in an expression. I'm not sure this is a possible way or even the best way, but after 2 days trying and failing, the time has come to search for expert help.

       

      The case is; In my QlickView I have one row of measurements given from our customers. The name of this row is "Height".

      In row 2 I have information of what the height really was after a controll measurement done by my colleagues. The name of this row is “RealHeight”.On top of that, I have a row with tolerances, based on the type of packaging.  The names of those two rows are “Tolerances” and “Packaging”.

       

      I want to make a check if the given “Height” from our customers is inside or outside the measurement done by our colleagues +/- the tolerance by setting 1 when the height is outside the tolerances and 0 when it is inside the tolerances.

      I’ve tried this IF-statement, but it doesn’t give me the expected result.

       

      SUM(IF((RealHeight + Tolerances) > Height, 0,
          
      IF((RealHeight -Tolerances)< Height, 0, 1)))

       

      Any ideas?