3 Replies Latest reply: Apr 9, 2015 4:35 PM by Ravikanth buggineni RSS

    Decoding Flag values

    Ravikanth buggineni

      I am new to Qlikview.


      How can I decode the Y,N and null values from a flag field to meaningful text .So that,user can select the required text

       

      Example:

       

      Condition

      if food_flag IN ('Y') then 'fruits'

      If food_flag IN ('Y','N')  then 'fruits and veg'

      else 'other food'

       

      could you please provide the syntax to write in expression for the bove condition.

        • Re: Decoding Flag values
          Nuno Faustino

          Hi,

           

          It is difficult to make the above condition in a selection box,  because you have non-exclusive grouping.

           

          In alternative you can have (either in the calculated dimension or in the script):

          if(flood_flag='Y','fruits',if(flood_flag='N','veg','other food'))


          Qlikview will perform better and allow you to select multiple values easily, to combine fruit and vegetables.

           

          If you really need to have that unconventional group you can create buttons that make selections.In the button (label it 'fruit and veg') and set the action to select value 'Y' on the filed flood_flag and another action to select value 'N'.

           

          I hope this helps.

           

          Kind regards,

          Nuno

          • Re: Decoding Flag values
            Amar Bogam

            Maybe you can write something like this as well..just an idea..you might have to make it dynamic..

             

            Table1:

            Load

            'Fruits' as Type

            where food_flag ='Y'

             

            concatenate

             

            Load

            'fruits and veg' as Type

            where food_flag ='Y'

             

            concatenate

            Load

            'fruits and veg' as Type

            where food_flag ='N'

             

            Thanks,

            • Re: Decoding Flag values
              Ravikanth buggineni

              Thank you so much for your response