Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I had a requirement of creating a QVD file with Current date. e.g. The name of the file will be Sales_24.02.2016.qvd.
I am able to do that by setting a variable in the script which will store today's date and then using the same with the file name.
i.e.
LET v_date=date(Today(),'DD.MM.yy');
And while creating the qvd:
Store sales into sales_$(v_date).qvd(qvd);
The qvd is generated with the proper name: sales_24.02.2016.qvd
However, I have a different query. At first, I created the variable like this:
LET v_date=today();
When I reloaded the qvw, error occurred: 'Execution script error'
And when I change it with LET v_date=date(Today(),'DD.MM.yy'); no error occurred. Clearly, the error occurred earlier is due to the declaration of the variable. But I did not understand why Today() function generated error and date(Today(),'DD.MM.yy') did not.
Can anyone explain how qlikview works in this case.
Thanks
i think ur date frmat is diffrnt
The script execution error probably originated somewhere else. Just like with my predecessor, both assignments work like a charm.
Can you upload a small demo document that has this problem? If we cannot reproduce the error, we won't find the cause.
Best,
Peter
add a trace and an exit after the variable assignment
if the reload is succesful , the prolem isn't the today()
LET v_date=today();
trace v_date=$(v_date);
EXIT Script;
Hi,
I add the trace as you suggested. The reload is successful.
However, while reloading the actual table with any of these variables, there's no error.
When I try to attach the variable(v=today()) with qvd name, the error occurs and use of date function(date(today(),'dd/MM/yyyy') resolves the issue.
Seems like issue is with date format.
Hi,
I think your default date format is dd/mm/yyyy or mm/dd/yyyy (or it has / in the date format). Generally windows file system won't allow / in the file name, that's why you got error while using Today() in variable.
If you change
LET v_date=date(Today(),'DD.MM.yy');
to
LET v_date=date(Today(),'DD/MM/yy');
You will also get error.
Hope this helps you.
Regards,
Jagan.
Hi Jagan,
You are right. When I changed the V_date to v_date in dd/mm/yy error occurred.
So, you are saying issue with default date format in windows file, is it?
Thanks
Hi, Sohini Bhattacharyyar.
The default format in DateFormat variable is DD/MM/YYYY. It contain slashs. This is rule of the System Operational, not save any file with character \ / : * ? "< >.
Hope this helps!
Yes, windows doesn't allow / in file name, instead of this you can - or _. Hope you got the answer, please close this thread by giving Correct answer.
Regards,
jagan.