Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Qvd file not able create in incremental load

Hi,

I am facing one issue. I have fact table file data and it is overriding daily. If I do normal script, QVD file will be override when fact table data is getting override on daily basis. So to overcome that, I have written code like this

If FileSize('$(Vqvdpath)test.qvd') > 0 then

test1:

    LOAD * FROM fact table;

Store table  into test.qvd(qvd);

  

DROP Table test1;

ENDIF.


But it is not creating any QVD file. please help me where it is going wrong.

Regards,

Kumar Reddy

20 Replies
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Your initial code is saying "if there is no QVD, then do nothing".

This will always result in no data.

Steve

Anonymous
Not applicable
Author

Thanks Steve.

In my script I am loading table data after If statement and storing that table as a QVD in STORE command. Can you explain me where it is going wrong.

Regards,

Kumar

Peter_Cammaert
Partner - Champion III
Partner - Champion III

The problem lies in the return value of FileSize(). How should the function make a distinction between a file with 0 bytes (FileSize=0) and a file that doesn't even exist yet?

In the second case, FileSize() returns NULL. Your IF should test for both NULL (QVD doesn't exist) and 0 (QVD contains nothing = useless file)

Peter

Anonymous
Not applicable
Author

Could you share the whole load script, especially the bit after the STORE you refer to ?

Anonymous
Not applicable
Author

Hi Bill,

Let Vqvxpath = 'D:\QlikView\SourceDocuments\QVX\Mktg_Funnel_Prj\';

Let Vqvdpath = 'D:\QlikView\SourceDocuments\QVD\Mktg_Funnel_Prj\';

If FileSize('$(Vqvdpath)test.qvd') > 0 then

test1:

    LOAD * FROM fact table;

Store test1into test.qvd(qvd);

  

DROP Table test1;

ENDIF.

Anonymous
Not applicable
Author

Hi Peter,

Here If I don't use IF statement QVD will be override with the latest data only, but i don't see any earlier data.

Regards,

Kumar

Anonymous
Not applicable
Author

Should there be a space between test1 and into instead of test1into

And should the Store command be against Vqvxpath, as in :

Store test1 into $(Vqvdpath)test.qvd(qvd);

Notwithstanding that, what this seems to be trying to do is :

If qvd file exists

    then

          Load data from source

          Store this data into qvd file [thus overwriting existing qvd file]

          Drop resident table

     else

          Do nothing

Is that what you wish ?

Anonymous
Not applicable
Author

What my actual requirement is.

Suppose I have a data like

  

dateAmount
18/12/201513
19/12/201514
20/12/201516

so my QVD will store this data.

So next this source will be override with the below data.

date           amount

21/12/2015    20

So finally in my QVD I want to see all 4 rows.

Regards,

Kumar

Anonymous
Not applicable
Author

Are you hoping that the STORE command will concatenate the additional data onto an existing qvd.

If so then that is not how the STORE command works.  It will overwrite the existing qvd with only the additional data, thus getting rid of the old data.

Anonymous
Not applicable
Author

I tried this way

test1:

LOAD * FROM

test.xlsx

(ooxml, embedded labels, table is Sheet1);

STORE test1 into C:\Users\Ramprasad\Desktop\Marketing funnel QVW\test.QVD(qvd);

If FileSize('C:\Users\Ramprasad\Desktop\Marketing funnel QVW/test.qvd') > 0 then

Concatenate(test1)

LOAD * From

C:\Users\Ramprasad\Desktop\Marketing funnel QVW\test.QVD(qvd);

DROP Table test1;

ENDIF