7 Replies Latest reply: Jul 17, 2016 12:36 PM by Mikel De RSS

    Prevent fields from loading

    Mikel De

      Hello!

       

      Below is a sample of my data and I wonder whether it is possible to use a LOAD expression that loads only the data associated to CountryA. I know that I can also use a filter, but I would prefer to load only the data I need from the beginning.

       

      CountryCustomerTurnover
      CountryAAA45968
      CountryAAB34589
      CountryAAC39458
      CountryBBA85393
      CountryBBB53749
      CountryCCA54522
      CountryCCB23865
      CountryCCC23654
      CountryDDA54233
      CountryDDB45633

       

      It would be also interesting to know, if I can exclude a particular country, e.g. load everything but CountryC. Thank you very much!

       

      -Mikel

        • Re: Prevent fields from loading
          Sunny Talwar

          May be like this:

           

          LOAD Country,

                    Customer,

                    Turnover

          FROM ....

          Where Country = 'CountryA';

           

          For excluding, you can try this:

           

          LOAD Country,

                    Customer,

                    Turnover

          FROM ....

          Where Country <> 'CountryC';

           

          Or you can use a Where Exists.

           

          IncludeCountryTable:

          LOAD * Inline [

          Country

          CountryA

          ];

           

          LOAD Country,

                    Customer,

                    Turnover

          FROM ....

          Where Exists(Country);

           

          This will only include CountryA because before this table Load, only CountryA was included in Country field.

           

          Alternatively, to exclude, you can try this:

           

          ExcludeCountryTable:

          LOAD * Inline [

          Country

          CountryC

          ];

           

          LOAD Country,

                    Customer,

                    Turnover

          FROM ....

          Where NOT Exists(Country);

            • Re: Prevent fields from loading
              Mikel De

              Hello and thank you very much for your response! I initially had some trouble because I did it like this:

               

              LOAD

              ...

              FROM ...

              Where [Country] = 'CountryA'

              (ooxml, embedded labels, table is [2016]);

               

              instead of:

               

              LOAD

              ...

              FROM ...

              (ooxml, embedded labels, table is [2016])

              Where [Country] = 'CountryA';

               

              Just in case somebody else needs this.

               

              Thanks again and have a nice weekend!

            • Re: Prevent fields from loading
              Mikel De

              I'm sorry, one more question - what expression should I use in order to aggregate a couple of countries into a region. Let's say I want to display CountryB+CountryC+CountryD as Europe_East.