Qlik Community

Ask a Question

New to QlikView

If you’re new to QlikView, start with this Discussion Board and get up-to-speed quickly.

Announcements
Qlik Highlights 2020 Giveaway! Watch, reply and have a chance to win a $200 Amazon Gift Card! Watch Video
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Table names not changed in load script

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.

Any ideas?

=====

Directory;
FeesSA2015:
LOAD.

     ...

FROM
[..\T_FEES_ARCOLE 2015.xlsx]
(
ooxml, embedded labels, table is T_FEES_ARCOLE);

Directory;
FeesSA2014:
LOAD.

     ...

FROM
[..\T_FEES_ARCOLE 2014.xlsx]
(
ooxml, embedded labels, table is T_FEES_ARCOLE);

3 Replies
Specialist
Specialist

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:

ABC:

LOAD EXCHANGECODE,

     FROMDATE,

     TODATE,

     EXCHANGERATE

FROM

(ooxml, embedded labels, table is Sheet3);

DEF:

LOAD EXCHANGECODE as EE,

     FROMDATE as DD,

     TODATE as CC,

     EXCHANGERATE as BB

FROM

(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:

Directory;
Fees:
LOAD

2015 as Year,

     ...

FROM
[..\T_FEES_ARCOLE 2015.xlsx]
(
ooxml, embedded labels, table is T_FEES_ARCOLE);

concatenate LOAD

2014 as Year,


     ...

FROM
[..\T_FEES_ARCOLE 2014.xlsx]
(
ooxml, embedded labels, table is T_FEES_ARCOLE);

Partner
Partner

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.

MVP
MVP

if you add a noconcatenate you'll get two tables (and a syn Table)


Directory;
FeesSA2015:
LOAD.  ...

FROM
[..\T_FEES_ARCOLE 2015.xlsx]
(
ooxml, embedded labels, table is T_FEES_ARCOLE);


FeesSA2014:

noconcatenate
LOAD.    ...

FROM
[..\T_FEES_ARCOLE 2014.xlsx]
(
ooxml, embedded labels, table is
T_FEES_ARCOLE);





maybe you can concatenate and add a field to "remember" the source

Directory;
FeesSA:
LOAD.  ..., 2015 as source

FROM
[..\T_FEES_ARCOLE 2015.xlsx]
(
ooxml, embedded labels, table is T_FEES_ARCOLE);


concatenate (FeesSA)
LOAD.    ..., 2014 as source

FROM
[..\T_FEES_ARCOLE 2014.xlsx]
(
ooxml, embedded labels, table is
T_FEES_ARCOLE);