3 Replies Latest reply: Jan 28, 2017 7:31 PM by s Walter RSS

    Created field not found

    s Walter

      Hi,

       

      In the load script, i create a new field (price) which doesn´t exist in the table. Then i use this field to create another field.

      If i load the data i get an error "the field price could not found".

       

      What must i do?

       

       

      LOAD
          ID,
          sDate,
          Product,
          SaleNumber,
          Customer,
          SaleNumber * 2 as price,
          price * 0,19 as tax
      FROM [lib://source/mehrere-spalten-vergleichen.xlsx]
      (ooxml, embedded labels, table is Tabelle1);
      

       

      Regards,

      sam !

        • Re: Created field not found
          Handry Orozco

          Hi Walter

          Table1:

          LOAD ID,

                     sDate,

                     Product,

                     SaleNumber,

                     Customer, 

                     SaleNumber * 2 as price, 

                     price * 0,19 as tax 

               FROM [lib://source/mehrere-spalten-vergleichen.xlsx] 

               (ooxml, embedded labels, table is Tabelle1); 


          Unquality *;

          NoConcatenate


          FinalTable:

               LOAD ID,

                         sDate,

                         Product,

                         SaleNumber,

                         Customer,

                         Price,

                         Price * 0,19 As Price

               Resident Table1;

               Drop Table Table1;


          Bye


          • Re: Created field not found
            Sunny Talwar

            I would do something like this:

             

            LOAD

                ID,

                sDate,

                Product,

                SaleNumber,

                Customer,

                SaleNumber * 2 as price,

                SaleNumber * 2 * 0,19 as tax

            FROM [lib://source/mehrere-spalten-vergleichen.xlsx]

            (ooxml, embedded labels, table is Tabelle1);

            • Re: Created field not found
              s Walter

              Thanks. This also works:

               

              set myFunction = $1 * 2;
              
              LOAD 
                  ID, 
                  sDate, 
                  Product, 
                  SaleNumber, 
                  Customer, 
                  $(myFunction(SaleNumber)) as price, 
                  $(myFunction(SaleNumber)) * 0,19 as tax 
              FROM [lib://source/mehrere-spalten-vergleichen.xlsx] 
              (ooxml, embedded labels, table is Tabelle1);
              

               

              regards,

              sam