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: 
Not applicable

FileTime() not working

I'm trying capture the date of the file I'm loading into Qlik and assigning the value to a variable to be added to a dashboard.

Set $File_Date = FileTime("\\path\excel.xlsx")

The text on the object property is set to:

='Last Updated'&$File_Date

What's printing in the object box on the dashboard is:

Last Updated FileTime("\\path\excel.xlsx")

It seems so simple, but I'm new to Qlik and can't this out. Thanks for any help!

Trista

1 Solution

Accepted Solutions
Not applicable
Author

Thank you all for your prompt responses!

This is what worked.....

Script:

LET $v_File_Date = FileTime('\\path\excel.xlsx');

I didn't realize I had to end it with a semi-colon ';'.

I'm assuming prefixing with "v_", is best practice for Qlik variables...

Then in object text box:

= 'Last Updated' & $v_File_Date

The result also included both the date and time. I was looking for just the date. But, this will do.

Last Updated

1/23/2017 9:31:25 AM


[Stefan]

You can get only the date part using e.g. Dayname():

LET $v_File_Date = DayName(FileTime('\\path\excel.xlsx'));

Result:

Last Updated

1/23/2017

THANK YOU ALL!!

View solution in original post

7 Replies
Anil_Babu_Samineni

Try

='Last Updated'& $(File_Date)

Or

='Last Updated'& '$(File_Date)'

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

Try this may be:

Set $File_Date = FileTime('\\path\excel.xlsx')

='Last Updated' & $($File_Date)

swuehl
MVP
MVP

Try with LET:

LET v_File_Date = FileTime('\\path\excel.xlsx');




Then in a text box:

= 'File time: ' & v_File_Date

satheshreddy
Creator III
Creator III

Hi Trista,

Have you to put value in Variable?

You had used filetime(), if you want to use this You should Use LET Variable.

LET $File_Date = FileTime('\\path\excel.xlsx')

='Last Updated' & $($File_Date)


Regards

Sathish

Not applicable
Author

Thank you all for your prompt responses!

This is what worked.....

Script:

LET $v_File_Date = FileTime('\\path\excel.xlsx');

I didn't realize I had to end it with a semi-colon ';'.

I'm assuming prefixing with "v_", is best practice for Qlik variables...

Then in object text box:

= 'Last Updated' & $v_File_Date

The result also included both the date and time. I was looking for just the date. But, this will do.

Last Updated

1/23/2017 9:31:25 AM


[Stefan]

You can get only the date part using e.g. Dayname():

LET $v_File_Date = DayName(FileTime('\\path\excel.xlsx'));

Result:

Last Updated

1/23/2017

THANK YOU ALL!!

swuehl
MVP
MVP

You can get only the date part using e.g. Dayname():

LET $v_File_Date = DayName(FileTime('\\path\excel.xlsx'));


If your request is resolved, then please close this thread by flagging helpful and/ or correct answers.

Not applicable
Author

Perfect Stefan! Thank you!