Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Created field not found

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 !

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

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

View solution in original post

3 Replies
handry_orozco
Partner - Contributor III
Partner - Contributor III

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


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);

Anonymous
Not applicable
Author

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