Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am loading forecasts into my app and we do not always have a Q1 forecast. I was wondering if there is a way to create an IF statement or something that only loads the script if it can find a file containing "Q1" and "fact"?
I am pretty new to Qlik so thanks in advance!
Hi,
what is happening here is it is trying to find if the file exists or not.
So the qvdcreatetime() takes the filename with path, so if you have QVD in the same location where your qvw is located you dont need the path, but if its not in same folder then you need path.
So try this.
IF(NOT isNull(qvdCreateTime('QVDPATH\EDB Raw Q3 Forecast Fact.qvd'))) THEN
LOAD *
FROM
(qvd);
END IF
Regards,
Kaushik Solanki
Hi,
Do you have a separate file for Q1 forecast or its a value in your forecast field?
Regards,
Kaushik Solanki
All of the forecasts are separate QVDs. So 4 separate QVDs.
So you want to load entire 4 QVDs only when the Q1 forecast is there?
Regards,
Kaushik Solanki
No. If Q1 QVD exists, I want to load it. If not, skip script. The other 3 are loaded regardless if Q1 is there or not.
Thank you,
Hi,
You can try loading all QVD at one go like below.
LOad * from c:\Forecast*.qvd(Qvd);
Here * will take all QVDS which is named as ForecastQ1,ForecastQ2 and so on.
If this doesnt suit your requirement then you can write a statement like below.
IF (NOT isNull(qvdCreateTime('myqvdfile.qvd'))) THEN
LOAD * FROM myqvdfile.qvd (qvd);
END IF
Regards,
Kaushik Solanki
Hi,
I am having trouble getting this to work. I am trying to test it with a Quarter I have to see if it will load but nothing is happening. Below is my script
IF(NOT isNull(qvdCreateTime('EDB Raw Q3 Forecast Fact.qvd'))) THEN
LOAD *
FROM
(qvd);
END IF
Hi
Try like this
LET vListqvdexists=isnull(QvdCreateTime('urpath\Filename.qvd')); // if qvd exists then 0 else -1
//if Qvd is exist then Delta loading Else Initial Loading.
if $(vListqvdexists)=0 THEN
LOAD *
FROM
(qvd);
END IF
Please try full path of the qvd
IF IsNull(FileSize('Z:\Qlikview_EDB\EDB Data\QVD\EDB Raw Q3 Forecast Fact.qvd'))=0 THEN
LOAD *
FROM
(qvd);
END IF
Hi,
what is happening here is it is trying to find if the file exists or not.
So the qvdcreatetime() takes the filename with path, so if you have QVD in the same location where your qvw is located you dont need the path, but if its not in same folder then you need path.
So try this.
IF(NOT isNull(qvdCreateTime('QVDPATH\EDB Raw Q3 Forecast Fact.qvd'))) THEN
LOAD *
FROM
(qvd);
END IF
Regards,
Kaushik Solanki