Discussion Board for collaboration related to QlikView App Development.
Hi, I'm trying to load different Excel sheets in a script to different tables but altrhoug I give a table name before each load statement, all sheets are loaded to the same table:
In the below example, the 2014 data is loaded in the FeesSA2015 table instead of in the FeesSA2014 table.
FROM [..\T_FEES_ARCOLE 2015.xlsx](ooxml, embedded labels, table is T_FEES_ARCOLE);
FROM [..\T_FEES_ARCOLE 2014.xlsx](ooxml, embedded labels, table is T_FEES_ARCOLE);
I think that it is because the data fields are identical - so QlikView loads the data into a single table.
I tried a similar set of circumstances and got the same results. If you wish different tables use different names like this:
(ooxml, embedded labels, table is Sheet3);
LOAD EXCHANGECODE as EE,
FROMDATE as DD,
TODATE as CC,
EXCHANGERATE as BB
(ooxml, embedded labels, table is Sheet4);
But I would suggest that you want to load the data into a single table and flag it differently. So I would change your script to read something like:
2015 as Year,
FROM[..\T_FEES_ARCOLE 2015.xlsx](ooxml, embedded labels, table is T_FEES_ARCOLE);
2014 as Year,
FROM[..\T_FEES_ARCOLE 2014.xlsx](ooxml, embedded labels, table is T_FEES_ARCOLE);
I agree with Rupert about loading one table, should you still want otherwise you can also use the NoConacatenate statement before each load statement after loading the first table.
And use Qualify *;, which will instead of manually having to rename the fields will place the table name in front of the Field name.
if you add a noconcatenate you'll get two tables (and a syn Table)
maybe you can concatenate and add a field to "remember" the source
Directory;FeesSA:LOAD. ..., 2015 as source
concatenate (FeesSA)LOAD. ..., 2014 as source