Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Creation of qvds using for loop in qlikview

Hi all,

I am new to Qlik view.I like to know how can i create Qvds using for loop.

for example i am having 20 Exel files in D;//,so i want these 20 files into qvd.

can u please share me the script for the above scinario. it will be helpfull to me.

regards

theja

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi Theja,

If all files are having the same columns then you can just load using wild card characters in a single shot, no need of looping.

Try like this

R:
LOAD

*

FROM

C:\Users\664801\Desktop\QV\*.xls]

(biff, embedded labels, table is [Sheet1$]);
STORE R into FileName.qvd(qvd);

Hope this helps you.

Regards,

jagan.

View solution in original post

10 Replies
Not applicable
Author

Hi plz help me..

sasikanth
Master
Master

HI

Following is the for loop used to create the qvds

 

FOR vCount = 0 to NoOfTables()-1

LET vTableName =TableName($(vCount));

STORE $(vTableName) INTO $(vTableName).qvd (qvd);

NEXT vCount

Not applicable
Author

Hi Theja,

Try this :

for i=0 to NoOfTables()-1

let vtabname=TableName(i);

STORE $(vtabname) into $(vtabname).qvd;

next

Not applicable
Author

Hi

you can try like this .....

FOR i = 1 to NoOfTables()

  LET vTableName = TableName($(i)-1);

  LET vOutfile = '$(vTableName).qvd';

  STORE [$(vTableName)] INTO [$(vOutfile)] (qvd);

NEXT i

Not applicable
Author

thank u all for helping me..


Not applicable
Author

Hi ,

You can use this script

just name your file in such a way that you can derived it inside for loop using i variable

for i=1 to 20

   let vfilename = $(i) & '.xlsx';

   Tab:

   LOAD *

   FROM

  [$(vfilename)]

  (ooxml, embedded labels, table is Sheet1);

  store Tab into $(i)&'.qvd'(QVD);

next i

Regards,

Vivek Singh

Anonymous
Not applicable
Author

Hi,

use this: 

for i=1 to No of tables
R:
LOAD

*

FROM

C:\Users\664801\Desktop\QV\$(i).xls

(biff, embedded labels, table is [Sheet1$]);
STORE R into $(i).qvd(qvd);
NEXT

HTH

Ravi N,


jagan
Luminary Alumni
Luminary Alumni

Hi Theja,

If all files are having the same columns then you can just load using wild card characters in a single shot, no need of looping.

Try like this

R:
LOAD

*

FROM

C:\Users\664801\Desktop\QV\*.xls]

(biff, embedded labels, table is [Sheet1$]);
STORE R into FileName.qvd(qvd);

Hope this helps you.

Regards,

jagan.

Not applicable
Author

Hi jagan,

thank for your answer...

I am not having the same columns in my files.the files which i am  having r diffrent from one another.

can i use wildcard for the same.or i want to use loop.

thanks

theja