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

Alternative to doing multiple table loads to create fields?

I am interested in figuring out a way to create fields out of my initial data load and then use those created fields to create new fields without needing to do multiple table loads. Below is an example of what I'm talking about:

Tmp:

Load *,

if(field1 = 1, 'value1',

if(field1 = 2, 'value2',

if(field3 = 3, 'value3'))) as created_field

Resident Master

Drop Table Master;

Rename table tmp to Master;

Tmp:

Load *,

if(created_field = 'value1', 'x'

if(created_field = 'value2', 'y'

if(created_field = 'value3', 'z'))) as created_field_2

Resident Master

Drop Table Master;

Rename table tmp to Master;

I have done this so many times that my qlikview script is very slow to load. Is there an alternative?

2 Replies
swuehl
MVP
MVP

Matthew,

seems I don't understand what you are trying to achieve. What's the benefit of loading the tables in that way instead of

Tmp:

Load *,

if(field1 = 1, 'x',

if(field1 = 2, 'y',

if(field3 = 3, 'z'))) as created_field_2

Resident Master

Drop Table Master;

Rename table tmp to Master;



Or even doing the same in a preceding LOAD to your master table LOAD?

Gysbert_Wassenaar

Use preceding loads:

Master:

Load *,

if(created_field = 'value1', 'x'

if(created_field = 'value2', 'y'

if(created_field = 'value3', 'z'))) as created_field_2

;

Load *,

if(field1 = 1, 'value1',

if(field1 = 2, 'value2',

if(field3 = 3, 'value3'))) as created_field

;

Load * From MySource;


talk is cheap, supply exceeds demand