Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

new field/variable

Hi,

i've this problem.

i want to load 2 file from excel in qlik.

They have the same structure (except for 1 variable  N_OF_PERSON), because they are database at different date.

The first excel  (DATE 20121231) doesn't have N_OF_PERSON, the second excel (DATE 20130131) contain N_OF_PERSON.

I want to recreate the same structure and create a blank (or zero) variable as N_OF_PERSON at 20121231

I try with:

Load *,

if([DATE]<20130131, 0, [N_OF_PERSON]) as [N_OF_PERSON]

From .....

It doesn't work, because at DATE 20121231 qlik could not find N_OF_PERSON.

How can i solve my problem?

Thank you

M

Labels (1)
3 Replies
bbi_mba_76
Partner - Specialist
Partner - Specialist

Hi,

you should avoid the load *, you could have two different load, one for each excel.

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Like this:

Load * from ...excelfile_with_all_fields...;

Load *, 0 as N_OF_PERSON from ...excelfile_missing_one_field...;


talk is cheap, supply exceeds demand
salto
Specialist II
Specialist II

Hi,

do two loads, one for every Excel:

Table:

LOAD

     Field1,    

     Field2,

     ...,

     0 as N_OF_PERSON  

FROM DATE_20121231.xls (biff, embedded labels, table is Sheet1$);

LOAD

     Field1,    

     Field2,

     ...,

     N_OF_PERSON  

FROM DATE_20130131.xls (biff, embedded labels, table is Sheet1$);

Hope this helps!