Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

prma7799
Honored Contributor III

Fetch date from excel file name

Hi All,

I have on one excel file like "Sale (Feb-2014).xlsx" .

I want to pick above Feb-2014 from excel and link to the master calender.


Need help.



Thanks,

Prashant

1 Solution

Accepted Solutions
MVP
MVP

Re: Fetch date from excel file name

Use filebasename(), like:

     Load *,

               Date(Date#(TextBetween(filebasename( ), '(',')' ), 'MMM-YYYY')) as Date

     From  <>;

View solution in original post

5 Replies
MVP
MVP

Re: Fetch date from excel file name

Use filebasename(), like:

     Load *,

               Date(Date#(TextBetween(filebasename( ), '(',')' ), 'MMM-YYYY')) as Date

     From  <>;

View solution in original post

prma7799
Honored Contributor III

Re: Fetch date from excel file name

Hi Tresesco,

It is working you have any master calender script so I link them to each other.

Thanks,

morris70
Valued Contributor

Re: Fetch date from excel file name

Hi

You could use the function "FileName" in your script. This will give you the whole filename.

To pick the actual date part out you can use the "Mid" function, you could also use "Subfield" as well but in this case that would require more steps.

This is an example of how it might look.

Mid(FileName(),6,8) As FileNameDate,

MVP
MVP

Re: Fetch date from excel file name

morris70
Valued Contributor

Re: Fetch date from excel file name

Trescos solution is of course much better, a bit early in the morning for me (05:00 local time)