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

NoConcatenate problem

Hello all,

I am trying to load two xls files with the same structure/column names. I want to load them separately to different tables. If I use statement below, the results are messed up.

Plus my second question is, how I f.e. create a graph and use only data from Data table? Because I'm gettin' (You have attempted to apply a numerical expression, which is not uniquely defined for the specified variable. In order to use this variable in expressiona relying on number of occurrences, please read it a second time under a new name from its primary table) statement.

Could you please help me? Thank you in advance.

 

Data:

LOAD  Country,

Airport,

Price


FROM ABCD

Data1:

NoConcatenate

LOAD   Country,

Airport,

Price

FROM
EFGH;

Labels (1)
1 Solution

Accepted Solutions
Matt
Contributor III
Contributor III
Author

An experienced colleague helped me, so I will share what works solving my problem.

I used concatenation

 

Data:

LOAD  Country,

Airport,

Price,

'Table_1' as Fact


FROM ABCD

Concatenate (Data)

LOAD   Country,

Airport,

Price,

'Table_2' as Fact

FROM
EFGH;

 

Creating graph need to use set analysis, f.e. Count({<Fact={'Table_2'}>} Airport)

View solution in original post

5 Replies
marcus_sommer

Usually there are quite rarely any benefits to load identically data-structures into different tables. Therefore I suggest to load them into a single table and if it's needed to differ between the tables you could add this as an additionally information, for example with: filebasename() as Source.

- Marcus

Matt
Contributor III
Contributor III
Author

Isn't filebasename() function working only with text files?

marcus_sommer

No, it will work will with Excel, too.

- Marcus

Matt
Contributor III
Contributor III
Author

An experienced colleague helped me, so I will share what works solving my problem.

I used concatenation

 

Data:

LOAD  Country,

Airport,

Price,

'Table_1' as Fact


FROM ABCD

Concatenate (Data)

LOAD   Country,

Airport,

Price,

'Table_2' as Fact

FROM
EFGH;

 

Creating graph need to use set analysis, f.e. Count({<Fact={'Table_2'}>} Airport)

Mike_Y
Contributor III
Contributor III

Hi Marcus,

I came across your reply.

Can you teach me the best practice to load same structure files into a single dataset, please?

 

Thanks.