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

Error In Script?

Hi All,

QVD's are not being generated for few tables with the below script.

Ex: I have following tables

Table_2014,

Table_2014_1,

Table_2015_2,

Table_2015_6 ..of these.. only few tables are getting stored to qvd's sometimes the 1st and 3rd gets loaded, and sometimes 2nd and 3rd table, but not all the tables.

this is wat i have written....

FOR i=0 to NoOfTables()-1

LET vTabName=TableName(0);

STORE [$(vTabName)] into \\QVDpath\$(vTabName).qvd (qvd);

DROP Table [$(vTabName)];

NEXT i

Is there any problem with tables naming convention...

John

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Do you have the same tables on every reload? And you get different number of tables stored with the same script?


Do you apply some conditional control script logic that may lead to removing / autoconcatenating tables on one reload but not on the other?

Have you tried adding some TRACE statements to track the number and names of all tables?

View solution in original post

17 Replies
Anonymous
Not applicable
Author

i do not know which table "Tablename(0)" is referencing as you drop this table after

what does next tablename(0) is getting?

as I understood Tablename(x) and NoOfTables() references to the previous loaded tables

so i would try: LET vTabName=TableName(i);

Anonymous
Not applicable
Author

I tried Wat u mentioned Rudolf, I am getting error at the store statement.

swuehl
MVP
MVP

Do you have the same tables on every reload? And you get different number of tables stored with the same script?


Do you apply some conditional control script logic that may lead to removing / autoconcatenating tables on one reload but not on the other?

Have you tried adding some TRACE statements to track the number and names of all tables?

Anonymous
Not applicable
Author

Hi.

I had some issues in the past with regards to Set and Let in a for loop.

Try using Set vTableName =....

alternatively you are going to have to pre-create a list of table names and then do a peek in your for loop. not as fast but you might need to do it in an alternate method.

  Gareth

Anonymous
Not applicable
Author

Swuehl, most of the tables are similar only slight change in suffix of the table name. I'm using the same script it is giving different results and finally no I have not used Trace statement. And also there are no conditional control logic or anything ...like that.

Anonymous
Not applicable
Author

Thanks Swuehl, I figured out the problem, there are 3 tables with same field names where all were auto concatenating.

Cud you please tell how to undo this autoconcatenation

jonas_rezende
Specialist
Specialist

Hi, johnlewis‌.

Verify the following:

  1. If before of LOOP the tables that contain fields common are concatened implicity. Thus, reduce the number of table.
  2. In TableName() function, use varible $(i). Example:

    FOR i = 1 to NoofTables()

    LET vTabName = TableName($(i)-1); //It is work only thus.

    STORE [$(vTabName)] into [$(QVDpath)\$(vTabName).qvd] (qvd);

    DROP TABLE vTabName;

FOR i;

Hope this helps!

Anonymous
Not applicable
Author

Use Noconcatenate function:

For example:

If the field names and number is same in 2 or more tables them QlikView performs an automatic concatenation but it is possible to prevent this automatic concatenation by using NoConcatenate

Let us load the same tables as in Part1 i.e. Table Cust_1 and Cust_2. These tables have same set of fields so they should get concatenated but this time load them by using NoConcatenate

Conc_NO_TableLoad

Conc_NO_TableViewer

Table viewer shows 2 tables. Automatic concatenation was prevented by using NoConcatenate.

Anonymous
Not applicable
Author

No Jonas, Its not working its throwing error