7 Replies Latest reply: Jan 27, 2017 6:01 AM by Dusan Miletic RSS

    Data load filter

    Lawrence Tzigersizoglou

      Hello,

       

      i am loading data from MS SQL and i want to filter certain fields without any aggregate. I have not been able to find a solution.

      Apparently "where" function does not exist in qliksense if i am not mistaken.

      So, i have a field with values of "AX1" " AX2" and "AX3". I want to filter my data and load only for "AX1".

      How do i do it?

      I know i can bypass with "if" and then hide null values but i do not find this efficient. I want to load only the necessary data.

      Please help me on the which function i should use but also the syntax and where in the script of data load editor i should put the command.

       

      Thank you all in advance,

      Lawrence

        • Re: Data load filter
          Petter Skjolden

          WHERE is available both in Qlik Sense and also in the SQL Server query where you should place it.

          • Re: Data load filter
            Petter Skjolden

            A load script could look like this:

             

            LOAD

                 *

            ;

            SQL

                 SELECT

                      order_no,

                      order_date,

                      amount,

                      customer_no

                 FROM

                           orders

                 WHERE

                      region = 'AX1'

            ;

             

            By putting the WHERE into the SQL's SELECT statement you filter away rows at the earliest possible stage. It is also possible to filter in the LOAD statement but then all the rows has to be sent to Qlik before the filtering takes place which will normally be very inefficient and slow.

             

            LOAD

                 *

            WHERE

                 region = 'AX1'

            ;

            SQL

                 SELECT

                      order_no,

                      order_date,

                      amount,

                      customer_no,

                      region

                 FROM

                      orders

            ;