Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Creating a new table and dropping the initial

I am loading a table and deriving a new column during the load. Then I want to create a new table where the new column is 'Passed', and just load those records, have them in the new table and drop the first table. Is below correct? For some reason when I run this, I get all empty, and NewTable does not appear.

FirstTable:

Load [field1],

[field2],

[field3],

If (([field3]='Yes' and [field2]='No'), 'Passed', 'Not Passed') as NewField

FROM

MyFileLocation;


NewTable:

Load *

Resident FirstTable

Where NewField='Y';

Drop Table FirstTable;


11 Replies
sunny_talwar

I think you missed the NoConcatenate...

FirstTable:

Load [field1],

[field2],

[field3],

If (([field3]='Yes' and [field2]='No'), 'Passed', 'Not Passed') as NewField

FROM

MyFileLocation;


NewTable:

NoConcatenate

Load *

Resident FirstTable

Where NewField='Y';


Drop Table FirstTable;


Without NoConcatenate, your NewTable won't be created because it has the same fields as FirstTable. So add that and you should be fine

tamilarasu
Champion
Champion

Sunny,

Where clause is also wrong. It should be either 'Passed' or 'Not Passed'.

Where NewField='Y';

Where NewField='Passed';