11 Replies Latest reply: Aug 1, 2012 3:00 PM by Rob Wunderlich RSS

    Problem with Null() function

      Hi All,

       

      I have a strange problem which I am really not being able to figure out and I request help.

       

      I have an expression which displays variables in this way ,

       

      if($(vYTDTarget_CY_Line_2.b_TS) = 0,null(),

      if($(vYTDTarget_CY_Line_2.b_TS) > 0, num(($(vYTD_CY_Line_2.b_TS)-$(vYTDTarget_CY_Line_2.b_TS))/$(vYTDTarget_CY_Line_2.b_TS),'#,##0.0%')

      ,

      if($(vYTDTarget_CY_Line_2.b_TS) < 0 , num(($(vYTDTarget_CY_Line_2.b_TS)-$(vYTD_CY_Line_2.b_TS))/$(vYTDTarget_CY_Line_2.b_TS), '#,##0.0%'))))

       

      According to the values, I have vYTDTarget_CY_Line_2.b_TS evaluate to 0.

       

      I have stored this expression in a variable vLine2b_grade_TS which when I display in a text object as $(vLine2b_grade_TS) I get a - sign ( As I have declared to have all null as " - ")

       

      Now, when I use the following expression in a text box,

       

      if(IsNull(vLine2b_grade_TS), null(),

                if(text(vLine2b_grade_TS)='-0.0%',2,

                If(vLine2b_grade_TS >= 0,4,

                if(vLine2b_grade_TS < -.05,0, 2))))

       

      I get a value of 4. Qlikview is taking the value of vLine2b_grade_TS as 0 instead of null(). Ideally this value should be 0 instead of 4.

       

      Request all your help and suggestions to resolve this.

       

      Thanks,

      Tutan