Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

QVD Generator

Hai,

if we have no data file means,dt is also generate a QVD file right...

but my requirement is, if there is no data in the file means,it shouldn't generate the QVD...

is there any condition for dt..

anyone help me..

thanks in advance.

1 Solution

Accepted Solutions
parimikittu
Creator II
Creator II

Hi, Check this  QVD_NAME: LOAD * frm file; if(noofrows('QVD_NAME')=0) then exit script; else store QVD_NAME into qvd; END

View solution in original post

14 Replies
parimikittu
Creator II
Creator II

Hi, Check this  QVD_NAME: LOAD * frm file; if(noofrows('QVD_NAME')=0) then exit script; else store QVD_NAME into qvd; END

Anonymous
Not applicable
Author

Thanks..But if i give exit script...what hppnd to next file..how it will fetch..??

so i have to place the file atlast???aah.

Not applicable
Author

Write Nested if statement then try

Last statement give the exist upto write the nested if

parimikittu
Creator II
Creator II

Hi Sindhu, Do you have a list of files to load into QVD and based on the data avaliablity in file, we need to add to the same qvd? Can you please explain you query?

Anonymous
Not applicable
Author

Hi reddy,

i can't undrstnd ur post

Anonymous
Not applicable
Author

yes vj,

i have list of files to load.in dt nly i need if there is no data file means it shouldn't generate the qvd.

and vj,ur post is helpful..but if we insert null records in qvd means we can write the expression..how to insert the null records in qvd.thanks in advance

parimikittu
Creator II
Creator II

Then u have use for loop on the files and then the above if condition for each File in filelist ('C:'&'\*.'&'.csv') // give corret file name QVD_NAME: LOAD * frm file; if(noofrows('QVD_NAME')=0) then   next File; else store QVD_NAME into qvd; END next file Why do need to insert null records? generatlly we try not to have null records in Qlik tables. If the post is helpful mark it helpful and mark it answered, thnq

Anonymous
Not applicable
Author

if i give next file means,will it  take next file???..what should i give for dt..i am asking the word.

pathiqvd
Creator III
Creator III

Hi Sindhu,

    Try this you will get

A:

LOAD ID, Marks

FROM [Test1.xlsx] (ooxml, embedded labels, table is Sheet1);

B:

LOAD ID, Age

FROM [Test2.xlsx] (ooxml, embedded labels, table is Sheet1);

C:

LOAD A

FROM [Test3.xlsx] (ooxml, no labels, table is Sheet1);

let vA=NoOfRows('A');

let vB=NoOfRows('B');

let vC=NoOfRows('C');

if $(vA)>=1 THEN

store A into C:\Users\A.qvd;

ELSEIF $(vA)<1 THEN

drop table A;

ENDIF

if $(vB)>=1 THEN

store B into C:\Users\B.qvd;

ELSEIF $(vB)<1 THEN

drop table B;

ENDIF

if $(vC)>=1 THEN

store C into C:\Users\C.qvd;

ELSEIF $(vC)<1 THEN

drop table C;

ENDIF

regards,