Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Field not found : Adding new field in current datasource

Hi everyone,

I am trying to add my new field to be added in current table (Field Time). However my previous data source do not have this field. I need to read my old data source (without new field), and new data source with (new field).

May I know the best way to added this new field into current table so that it will not impact the performance of reloading the qvw.


Below are my table :


FactTable:

LOAD

ID,

Date,

UserName,

Age,

Time      //newfield

FROM

[..\..\..\DataSource\Test\Excel1_*.xls]

//(html, codepage is 1252, embedded labels, table is @1);

Concatenate(FactTable)

LOAD

ID,

Date,

UserName,

Age,

Time      //newfield

FROM

[..\..\..\DataSource\Test\Excel2_*.xls]

//(html, codepage is 1252, embedded labels, table is @1);

1 Solution

Accepted Solutions
sunny_talwar

Assuming that Excel1 is your old datasource and Excel2 as new, you might be able to do something like this:

FactTable:

LOAD

ID,

Date,

UserName,

Age,

Null() as Time      //newfield

FROM

[..\..\..\DataSource\Test\Excel1_*.xls]

//(html, codepage is 1252, embedded labels, table is @1);

Concatenate(FactTable)

LOAD

ID,

Date,

UserName,

Age,

Time      //newfield

FROM

[..\..\..\DataSource\Test\Excel2_*.xls]

//(html, codepage is 1252, embedded labels, table is @1);

View solution in original post

4 Replies
sunny_talwar

Assuming that Excel1 is your old datasource and Excel2 as new, you might be able to do something like this:

FactTable:

LOAD

ID,

Date,

UserName,

Age,

Null() as Time      //newfield

FROM

[..\..\..\DataSource\Test\Excel1_*.xls]

//(html, codepage is 1252, embedded labels, table is @1);

Concatenate(FactTable)

LOAD

ID,

Date,

UserName,

Age,

Time      //newfield

FROM

[..\..\..\DataSource\Test\Excel2_*.xls]

//(html, codepage is 1252, embedded labels, table is @1);

Not applicable
Author

Hi Sunny,

Thanks for reply

Just fyi Excel 1 & 2 are different table. There will be new field in both excel.

sunny_talwar

If both of them will have the field then what you originally had should work:

FactTable:

LOAD

ID,

Date,

UserName,

Age,

Time      //newfield

FROM

[..\..\..\DataSource\Test\Excel1_*.xls]

//(html, codepage is 1252, embedded labels, table is @1);

Concatenate(FactTable)

LOAD

ID,

Date,

UserName,

Age,

Time      //newfield

FROM

[..\..\..\DataSource\Test\Excel2_*.xls]

//(html, codepage is 1252, embedded labels, table is @1);

What exactly was the issue when you used the code you posted?

Not applicable
Author

Hi Sunny,

The issue is my previous data, does not contain the new field which is Time. So when I reload the qvw, it prompts error.(Field not found)