Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
rendiyan
Partner - Creator
Partner - Creator

[ASK] Error multiple concatenate to table inside loop

Dear Qlik Master,

i have a load script that use loop and works fine, sample like below :

Original Load Script

Marketing_Budget:

LOAD * INLINE [

    INITIAL

    1

];

FOR nrow = 0 TO noOfRows('MS_Connection') - 1

    LET vDB = peek('ODBC',$(nrow),'MS_Connection');

    Let vFlag = peek('PATH_LEGAL',$(nrow),'MS_Connection');

  $(vDB);

Concatenate(Marketing_Budget)

SQL select DISTINCT

substring(PROJECTNO FROM 4 FOR 2) AS Code_Branch,

'$(vFlag)' AS Kode_Legal,

ASD.*

from Marketing ASD

;

next;

But when i try to add more script to concatenate to another table, error show up, and the query is like below :

New Load Script

Marketing_Budget:

LOAD * INLINE [

    INITIAL

    1

];

ErrorLog_Tbl:

LOAD * INLINE [

    INITIAL_ELT

    1

];

FOR nrow = 0 TO noOfRows('MS_Connection') - 1

    LET vDB = peek('ODBC',$(nrow),'MS_Connection');

    Let vFlag = peek('PATH_LEGAL',$(nrow),'MS_Connection');

  $(vDB);

Concatenate(Marketing_Budget)

SQL select DISTINCT

substring(PROJECTNO FROM 4 FOR 2) AS Code_Branch,

'$(vFlag)' AS Kode_Legal,

ASD.*

from Marketing ASD

;

Concatenate(ErrorLog_Tbl)

LOAD * INLINE[

LEGAL

'$(vFlag)'

];

next;

And the error is :

Error New Load Script

Syntax error, missing/misplaced FROM:

Concatenate(ErrorLog_Tbl)

LOAD * INLINE[

LEGAL

'DTABB0'

]

Concatenate(ErrorLog_Tbl)

LOAD * INLINE[

LEGAL

'DTABB0'

]

I've tried to add set ErrorMode=0;

Also i've tried to test with static value for my second concatenate, remove single quote for my second concatenate.

But still, mw second concatenate script doesn't add up.

Why is this happening?

And is there any solution for this issue?

Many thank you,

Best Regards

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Just a quick try:    try putting space between 'INLINE' and '['  , like:

LOAD * INLINE  [

LEGAL

'$(vFlag)'

];

View solution in original post

2 Replies
tresesco
MVP
MVP

Just a quick try:    try putting space between 'INLINE' and '['  , like:

LOAD * INLINE  [

LEGAL

'$(vFlag)'

];

rendiyan
Partner - Creator
Partner - Creator
Author

it works.

what a funny error

thank you