Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Your initial code is saying "if there is no QVD, then do nothing".
This will always result in no data.
Steve
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
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
Could you share the whole load script, especially the bit after the STORE you refer to ?
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.
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
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 ?
What my actual requirement is.
Suppose I have a data like
date | Amount |
18/12/2015 | 13 |
19/12/2015 | 14 |
20/12/2015 | 16 |
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
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.
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