4 Replies Latest reply: Aug 25, 2014 1:28 AM by Vivek Singh RSS

    Load Statment

    UPALI WIJERATNE

      I have following data in a table

       

      Phone_No                           Calls         

      0112-8536541
      0773-4125051
      • 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

      I want to load only the data where no of calls >=2 from a single line(highlighted in red). Pls help me to write the script

        • Re: Load Statment
          Nagaian Krishnamoorthy

          Try the following script:

          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 Statment
            Marco Wedel

            Hi,

             

            one solution with preceding loads only:

             

            tabCalls:
            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/130537]
            (html, codepage is 1252, no labels, table is @1);
            

             

            QlikCommunity_Thread_130537_Pic1.JPG.jpg

             

            hope this helps

             

            regards

             

            Marco

            • Re: Load Statment
              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.

              • Re: Load Statment

                Hi,

                 

                Use this Script

                 

                 

                LOAD @1 as Phone_No, 

                     @2 as Calls 

                FROM [http://community.qlik.com/thread/130537

                (html, codepage is 1252, no labels, table is @1); 

                 

                 

                NoConcatenate

                 

                 

                tab1:

                LOAD Phone_No,    

                     Sum(Calls) as Calls 

                     Resident tab

                     Group By Phone_No;

                    

                NoConcatenate

                 

                 

                LOAD Phone_No,

                     Calls

                     Resident tab1

                     Where Calls >= 2;

                    

                Drop Table tab;

                Drop Table tab1;