1 Reply Latest reply: Jul 22, 2016 7:23 AM by Sunny Talwar RSS

    Nested IF statement as a variable in the Script

    Thomas Randell

      Question: How are the below variables written in the script? The Qlik Sense application sits on the SERVER, hence the requirement for                 SCRIPT VARIABLES.



      vUserProductGroup

      concat(Distinct Site_Master_Person_Product_Group)


      vProductDivision   

      =if($(vUserProductGroup) = 'MOBILE','IM', if($(vUserProductGroup) = 'TV','TVAV'))




      This is the KPI expression:

      *************************************************************************************************

      if(vProductDivision = 'IM',

      (sum({<[Product PREMIUM] = {'Premium'},[Product RM Division] = {$(vProductDivision)}>}Sell_Out_Qty)

      /

      sum({<[Product RM Division] = {$(vProductDivision)}>}Sell_Out_Qty)),

       

      if(vProductDivision = 'TVAV',

       

       

      (sum({<[Product PREMIUM] = {'PREMIUM'},[Product RM Division] = {$(vProductDivision)}>}Sell_Out_Qty)

      /

      sum({<[Product RM Division] = {$(vProductDivision)}>}Sell_Out_Qty))))

      *************************************************************************************************