3 Replies Latest reply: Aug 24, 2014 9:44 PM by jagan mohan rao appala RSS

    LOAD STATEMENT

    UPALI WIJERATNE

      I have following data in a table

       

      Phone Line                        calls                                 

      0779-6207761
      0723-6644621
      0112-53773601
      0775-5100121
      0773-7583303
      0776-2020731
      0774-0308961
      0777-4426241
      0776-1276358
      0777-8961681
      0777-3457761
      060-26305041
      0716-0155401
      0775-3437391
      0714-22201225
      0716-8399731
      0773-4053511
      0112-7968961
      0414-3978021
      0777-4474462
      0773-5591332
      0716-8222501

      I want to load only  data where calls >=2 from a single phone line. Pls help me to write the script for the same

        • Re: LOAD STATEMENT
          Nagaian Krishnamoorthy

          Try the following

          X:

          LOAD RowNo() as No, * Inline [

          Phone_No,Calls        

          0112-853654,1

          0773-412505,1

          0773-675076,1

          0779-620776,1

          0779-620776,1

          0779-620776,1

          0775-510012,1

          0773-758330,1

          0773-758330,1

          0774-030896,1

          0777-442624,1

          0776-127635,1

          0777-896168,1

          0777-345776,1

          060-2630504,1

          060-2630504,1

          060-2630504,1

          0714-222012,1

          0716-839973,1

          0773-405351,1

          0112-796896,1

          0414-397802,1

          0777-447446,1

          0773-559133,1

          0716-822250,1

          ];

          Y:

          NoConcatenate

          LOAD Phone_No where Count > 1;

          Load Phone_No,Sum(Calls) as Count Resident X Group By Phone_No;

          Left Join (Y) LOAD Phone_No, Calls,No Resident X;

          Drop Table X;

          • Re: LOAD STATEMENT
            Marco Wedel

            Hi,

             

            another solution with preceding loads only:

             

            LOAD Phone_No, Calls Where Calls >= 2;
            LOAD Phone_No, Sum(Calls) as Calls Group By Phone_No;
            LOAD @1 as Phone_No, @2 as Calls
            FROM [http://community.qlik.com/thread/130536] (html, codepage is 1252, no labels, table is @1);
            

             

            QlikCommunity_Thread_130536_Pic1.JPG.jpg

             

            hope this helps

             

            regards

             

            Marco

            • Re: LOAD STATEMENT
              jagan mohan rao appala

              Hi,

               

              Try like this

               

              Data:

              LOAD Phone_No,

                   Calls

              Where Calls >= 2; 

              LOAD Phone_No,

                   Sum(Calls) as Calls

              Group By Phone_No; 

              LOAD Phone_No,

              Calls

              FROM DataSource;

               

              Hope this helps you.

               

              Regards,

              Jagan.