2 Replies Latest reply: Feb 23, 2013 12:22 AM by Naveenchellaaraam Dhanabalan RSS

    Script not assigning values to variables

      Hi

      I am using Qlikview 11.2. I have this following table

      HeatMap_Rules_Key

      Condition

      MinValue

      MaxValue

      Color

      1

      Between

      0

                  25

      Red

      2

      Between

      25

                  50

      Blue

      3

      Between

      50

      100

      Green

      4

      Between

      100

      125

      Orange

       

      The table will have only four rows and i need to take each condition into a variable.

      I have created four variables Condition1,Condition2,Condition3,Condition4.

       

      I am using the following script

       

      SQL SELECT Color = 255,

          Condition As Cond,

          "HeatMap_Rules_Key",

          "Max_Value" AS UL,

          "Min_Value" AS LL

      FROM QlikView.dbo."HeatMap_Config";

       

       

      LET Condition1 = FieldValue('Cond',1);

      LET Condition2 = FieldValue('Cond',2);

      LET Condition3 = FieldValue('Cond',3);

      LET Condition4 = FieldValue('Cond',4);

       

      The result when using the table above is

       

      Condition1 = Between

      Condition2 =

      Condition3 =

      Condition4 =

       

       

      When i execute the script only the first variable is assigned the value('Between') and the other variable are NULL;

      If i have a different string(i.e. other than 'between' as in the table below) all the variables are getting their values assigned.

       

      HeatMap_Rules_Key

      Condition

      MinValue

      MaxValue

      Color

      1

      Between

      0

                  25

      Red

      2

      one

      25

                  50

      Blue

      3

      two

      50

      100

      Green

      4

      three

      100

      125

      Orange

       

      The result when using this table is

       

      Condition1 = Between

      Condition2 = one

      Condition3 = two

      Condition4 = three

       

       

      Can anyone help me with this?