Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Matt
New 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
New Contributor III

Re: NoConcatenate problem

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)

5 Replies
MVP & Luminary
MVP & Luminary

Re: NoConcatenate problem

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
New Contributor III

Re: NoConcatenate problem

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

MVP & Luminary
MVP & Luminary

Re: NoConcatenate problem

No, it will work will with Excel, too.

- Marcus

Matt
New Contributor III

Re: NoConcatenate problem

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
New Contributor III

Re: NoConcatenate problem

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.