7 Replies Latest reply: Jun 28, 2018 10:14 PM by Andy Manuja RSS

    Filter Data using Flags

    Andy Manuja

      Hi,

       

      I got an issue with regard to the use of flags to filter the data.

       

      Assume I got a table as mentioned below,

       

         

      Prod_IDProd_NameDateQuantitySelling PriceCountry1
      P100A10/02/20182010NZ
      P101B15/03/20181515AUS
      P102C14/01/2018285UK
      P103D20/03/20183010AUS
      P103D10/01/20181415NZ
      P104E25/02/20182820DEN
      P102C10/04/20183010NZ

       

       

      I am using a flag (named Flag1) to filter the data where the Country is "NZ' ,the quantity is greater than 15 and the Selling Price > 15.

      Thus the result should be something like below,

       

         

      Prod_IDProd_NameDateQuantitySelling PriceCountry1
      P100A10/02/20182010NZ
      P102C10/04/20183010NZ

       

      The sample statement to set the flag would be,

       

      "If(Country = 'NZ' and Quantity >15 and "Selling Price" >10,1,0) as Flag1"

       

      Once I have loaded the data to Qlik Sense, I need to visualize the data (May be in a Table format) after application of the filter.

       

      Without applying the filter (may be as an expression), it will display the entire 7 data records.

       

      Could anyone please explain me how to accomplish the above task cos I am posting this discussion for the second time.

       

      Note

      Kindly explain where I need to apply the expressions to filter the data and visualize only the output results in Qlik Sense after the "Data Load" process.

       

      Awaiting for you valuable reply.

       

      Regards

      Andy

        • Re: Filter Data using Flags
          youssef belloum

          Hi,

           

          if you're creating the Filter Flag 1, just use the Value 1 in a listbox for example and all the table will be filtered as expected.

           

          what is the issue here ?

            • Re: Filter Data using Flags
              Andy Manuja

              Hi Youssef,

              I could use the below code to load the original data in to qlik sense,

              Table:

              LOAD

                  Prod_ID,

                  Prod_Name,

                  Date,

                  Quantity,

                  Selling Price,

                  Country1,

                  If(Country = 'NZ' and Quantity >15 and "Selling Price" >10,1,0) as Flag1

              FROM (XXXX)

               

              Assume I load the data in to qlik sense and go to "App Overview" to create a table and visualize the data, it will show the entire data set as below,

               

              Requirement?

              I want to visualize the data which fulfills the requirement of the Flag.

               

              Note

              I have heard that there is an option to create an expression for fields so that it will only presents the filtered data. ( According to the scenario it should be something like,

               

              I know it is bit tricky to explain, but actually may be a simple thing I am missing here.

              Hope you understood the issue now.

               

              Look forward to hearing from you.

               

              Regards,

               

              Andy