Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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;
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)
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
Isn't filebasename() function working only with text files?
No, it will work will with Excel, too.
- Marcus
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)
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.