Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
arzuatasever
Contributor
Contributor

Replace load issue

I want to concat the tables. so I use this script but it doesn't work

I am sharing the errow below. how can I work on this?

thanks

FOR i = 0 to NoOfTables()
TableList:
LOAD TableName($(i)) as Tablename AUTOGENERATE 1
WHERE WildMatch(TableName($(i)), 'ZCS_BOM_EXPL_MAT_V2*');
NEXT i

 

FOR i = 1 to FieldValueCount('Tablename')

LET vTable = FieldValue('Tablename', $(i));
Concatenate (ZCS_BOM_EXPL_MAT_V2)
LOAD * RESIDENT [$(vTable)];
DROP TABLE [$(vTable)];
NEXT i;

DROP TABLE TableList;

 

arzuatasever_0-1628062610591.png

 

3 Replies
Vegar
MVP
MVP

It looks like your TableList does not autoconcatenate correctly. I notice TableList-6, TableList-7, TableList-8, etc. 

What does your datamodel look like after the first loop and have you controlled the content of the Tablename field. 

I am also concerned about your Where condition,
 WildMatch(TableName($(i)), 'ZCS_BOM_EXPL_MAT_V2*');, as it will include the table you are concatenating everything into, the ZCS_BOM_EXPL_MAT_V2 table. 

arzuatasever
Contributor
Contributor
Author

Hi Vegar,

tablelist tables include other table names. for excamle ZCS_BOM_EXPL_MAT_V2-3, ZCS_BOM_EXPL_MAT_V2-4 etc.

I want to concat some tables that are ZCS_BOM_EXPL_MAT_V2-3, ZCS_BOM_EXPL_MAT_V2-4, ZCS_BOM_EXPL_MAT_V2-5 etc.  so I write ZCS_BOM_EXPL_MAT_V2* for find to all of them

Vegar
MVP
MVP

I understand but by using ZCS_BOM_EXPL_MAT_V2* you will also include the ZCS_BOM_EXPL_MAT_V2 table in your TableList. And if so then you would probably drop that table somewhere in the final loop .