Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
vireshkolagimat
Creator III
Creator III

qvd generation

Hi All,

I have below script to generate the QVD flles from excel file.

table1:

Load * from file1.xlsx;

table2:

Load * from file2.xlsx;

table3:

Load * from file3.xlsx;

// Script to generate the QVD files using for loop.

for i=0 to NoOfTable()-1

Let vTableName = TableName(0);

Store $(vTableName ) into $(vTableName ).qvd (QVD);

Drop table $(vTableName);

Next i

But it is generating only one QVD which contains all the three files data.

I need to store the individual data in separate QVD file.

Am i missing something in the above script?

i tried to generate the individual QVD file after each load statment like

store table into table.qvd.

In the above situation also i am getting only on e QVD file for first table.

thanks for your suggestion

Regards,

Viresh

3 Replies
julian_rodriguez
Partner - Specialist
Partner - Specialist

Hello Viresh?

The three files have the same columns?

When you are loading the same fields from different tables, Qlik will make a automatic concatenation.

If it's your case, you can do one of this solutions:

1. Avoid the automatic concatenation, usen the sentence "NoConcatenate" before the second and third LOAD statement. Please note that if you keep this tables on memory, it will create a complex Syntetic Key. To avoid this, they must be concatenated or deleted.

table1:

Load * from file1.xlsx;

NoConcatenate

table2:

Load * from file2.xlsx;

NoConcatenate

table3:

Load * from file3.xlsx;

// Script to generate the QVD files using for loop.

for i=0 to NoOfTable()-1

Let vTableName = TableName(0);

Store $(vTableName ) into $(vTableName ).qvd (QVD);

Drop table $(vTableName);

Next i

Result:

Load * Resident table1;

Load * Resident table2;

Load * Resident table3;


Drop table table1, table2, table3

2. Store each table after the load.

table1:

Load * from file1.xlsx;

Store table1 into table1.qvd (qvd);

NoConcatenate

table2:

Load * from file2.xlsx;

Store table2 into table2.qvd (qvd);


NoConcatenate

table3:

Load * from file3.xlsx;

Store table3 into table3.qvd (qvd);


Result:

Load * Resident table1;

Load * Resident table2;

Load * Resident table3;


Drop table table1, table2, table3


Regards!

vishsaggi
Champion III
Champion III

As Julian mentioned use NoConcatenate in you load scripts and it should work. And remove the spaces in the store command like:

for i=0 to NoOfTable()-1

Let vTableName = TableName(0);

Store $(vTableName) into $(vTableName).qvd (QVD); \\ You had spaces near the variable name.

Drop table $(vTableName);

Next i

maxgro
MVP
MVP

you can move the load in the for loop

for i=1 to 3

  [table$(i)]:

  load * from file$(i).xlsx;

  Store [table$(i)] into [table$(i)].qvd (QVD);

  Drop table [table$(i)];

Next i