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

CASE 300 How to load multiple raw data using 1 load script.

Hi All

Below load script working fine :-

Directory;
LOAD COY,
'A' as SOURCE,
SALES
FROM
COY_A.xlsx
(ooxml, embedded labels, table is COY_A);

Concatenate

LOAD COY,
'B' as SOURCE,
SALES
FROM
COY_B.xlsx
(ooxml, embedded labels, table is COY_B);

I like to convert the below load script :-


For Each i in A,B
Directory;
LOAD COY,
'i' as SOURCE,
SALES
FROM
COY_A.xlsx
(ooxml, embedded labels, table is COY_i);
NEXT i;

I get error msg :-
Field not found - <COY>

Paul

1 Solution

Accepted Solutions
Vegar
MVP
MVP

I haven't access to QlikView today, but by the look of your post sample I would try these adjustments.

For Each i in 'A','B'

  LOAD COY,

  '$(i)' as SOURCE,

  SALES

  FROM

  COY_$(i).xlsx (ooxml, embedded labels, table is COY_$(i));

NEXT i;

View solution in original post

4 Replies
Vegar
MVP
MVP

I haven't access to QlikView today, but by the look of your post sample I would try these adjustments.

For Each i in 'A','B'

  LOAD COY,

  '$(i)' as SOURCE,

  SALES

  FROM

  COY_$(i).xlsx (ooxml, embedded labels, table is COY_$(i));

NEXT i;

paulyeo11
Master
Master
Author

Hi Sir

Below script work fine , now i like to know how to how to change the SOURCE field , value A to A_COY

For Each i in 'A','B'

LOAD COY,

'$(i)' as SOURCE,

SALES

FROM

C:\TEMP\COY_$(i).xlsx (ooxml, embedded labels, table is COY_$(i));

NEXT i;

I am sure i can achieve above by Partial reload ? Any way to load it at the above load script ?

Paul

paulyeo11
Master
Master
Author

Hi Sir

I try to use your script for 2 different raw data , i need to combine them into 1 table. i get error.

can you advise me on below link :-

https://community.qlik.com/t5/QlikView-Scripting/Why-i-can-not-add-Concatenate-in-between-FOR/td-p/1...

Paul