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

Load statement/SQL - "Field not found"

Hello,

I need help with below script.

Not sure why it is giving error while loading from Table1 which is coming from database.

When Table1 was loaded from excel it didn't gave any error and was able to read all the fields.

--> script

Table1:

SQL SELECT

          FIELD_A,

          FIELD_B,

          FIELD_C

FROM .... ;

Table2:

LOAD FIELD_A,

Subfield(FIELD_C, '#', 1) as temp1;

SubField(FIELD_C, '#', 2) as temp2;

LOAD FIELD_A,

Subfield(FIELD_C, '$') as temp3;

LOAD FIELD_A, FIELD_C

Resident Table1;

-->error

Field not found - <FIELD_C>

LOAD FIELD_A, FIELD_C

Resident Table1;

Kindly help

Thank you

Kinjal

1 Solution

Accepted Solutions
sunny_talwar

Try this

Table1:

SQL SELECT

          FIELD_A,

          FIELD_B,

          FIELD_C

FROM .... ;

Table2:

LOAD FIELD_A,

Subfield(temp3, '#', 1) as temp1;

SubField(temp3, '#', 2) as temp2;

LOAD FIELD_A,

Subfield(FIELD_C, '$') as temp3;

LOAD FIELD_A, FIELD_C

Resident Table1;

View solution in original post

3 Replies
sunny_talwar

Try this

Table1:

SQL SELECT

          FIELD_A,

          FIELD_B,

          FIELD_C

FROM .... ;

Table2:

LOAD FIELD_A,

Subfield(temp3, '#', 1) as temp1;

SubField(temp3, '#', 2) as temp2;

LOAD FIELD_A,

Subfield(FIELD_C, '$') as temp3;

LOAD FIELD_A, FIELD_C

Resident Table1;

Colin-Albert

No need to use a resident load for this it can be done in a single pass.

You had an error because your preceeding load for Table2 did not include FIELD_C as an output to the next stage

This will work without needing a resident load.

Table1:

LOAD          // This loads runs second

     FIELD_A,

     Subfield(temp3, '#', 1) as temp1;

     SubField(temp3, '#', 2) as temp2;

LOAD      // This load runs first

     *,

     Subfield(FIELD_C, '$') as temp3;

SQL SELECT

          FIELD_A,

          FIELD_B,

          FIELD_C

FROM .... ;

Have a look at this blog for more detailsPreceding Load

kinjal1645
Creator
Creator
Author

Thank you