2 Replies Latest reply: Dec 6, 2017 11:52 AM by Keith Blythe RSS

    Load Script Error

    Keith Blythe

      Hello, I am attempting to use a load script to summarize a quantity by month from a few different data sources.  Within the data sources the quantity is for a specific date.  I will ultimately want to display this data in a table (or pivot table) by month.  I commented out most of my script and it currently only includes the following logic:

       

      LOAD

          Date("Ship Date",'MMM-YYYY') as "Ship Date",

          "Sold-to pt",

          "Sold To Name",

          Plnt,

          Material,

          Description,

          sum(Open),

          SU,

          1 as Source   

      FROM [lib://Judy/futuredemand.qvd]

      (qvd) group by Plnt, [Sold-to pt], Material, [Ship Date];

       

      The goal here is to summarize the Open value by plant, sold-to, material and ship date (month/year).

       

      I get the follow error:

       

      The following error occurred:

      Invalid expression

      The error occurred here:

      LOAD

          Date("Ship Date",'MMM-YYYY') as "Ship Date",

          "Sold-to pt",

          "Sold To Name",

          Plnt,

          Material,

          Description,

          sum(Open),

          SU,

          1 as Source   

      FROM [lib://Judy/futuredemand.qvd]

      (qvd) group by Plnt, [Sold-to pt], Material, [Ship Date]

      The following error occurred:

      Invalid expression

      The error occurred here:

      ?

       

      Does anyone have any suggestions for the cause of this error?

       

      Thank you

        • Re: Load Script Error
          omar bensalem

          when u use an aggregation in the script, u have to group by all the other fields:

           

           

          load

          "Ship Date",

              "Sold-to pt",

              "Sold To Name",

              Plnt,

              Material,

              Description,

              sum(Open),

              SU,

            Source 

          group by Plnt, [Sold-to pt], Material, [Ship Date], "Sold To Name", Description,  SU,  Source 

           

          LOAD

              Date("Ship Date",'MMM-YYYY') as "Ship Date",

              "Sold-to pt",

              "Sold To Name",

              Plnt,

              Material,

              Description,

             (Open),

              SU,

              1 as Source  

          FROM [lib://Judy/futuredemand.qvd]

          (qvd) ;