Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
sohb2015
Contributor III
Contributor III

Storing QVD file with Current Date

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

8 Replies
Chanty4u
MVP
MVP

i think ur date frmat is diffrnt

today.png

Peter_Cammaert
Partner - Champion III
Partner - Champion III

The script execution error probably originated somewhere else. Just like with my predecessor, both assignments work like a charm.

LET Error thread207133.jpg

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

maxgro
MVP
MVP

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;

sohb2015
Contributor III
Contributor III
Author

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.



jagan
Luminary Alumni
Luminary Alumni

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.

sohb2015
Contributor III
Contributor III
Author

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

jonas_rezende
Specialist
Specialist

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!

jagan
Luminary Alumni
Luminary Alumni

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.