Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Save $600 on Qlik Connect registration! Sign up by Dec. 6 to get an extra $100 off with code CYBERSAVE: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
mwscott1
Creator
Creator

How to load files with dates in name

I have a file that is automatically generated and replaced everyday by a file with same file name except the date changes.

Example = NEW_AGENT_2016.09.22.TXT

I only need to pull current days file. Is there a way to do this without going in and updating the load statement everyday with the new file name?

LOAD [Agent Code],

     [Agent Name],

     [Curr Rep Type]

    

FROM

[\\FILE_LOCATION\NEW_AGENT_2016.09.22.TXT]

(txt, utf8, embedded labels, delimiter is ',', msq);

1 Solution

Accepted Solutions
sunny_talwar

May be like this:

LET vDate = Date(Today(), 'YYYY.MM.DD');

LOAD [Agent Code],

    [Agent Name],

    [Curr Rep Type]

   

FROM

[\\FILE_LOCATION\NEW_AGENT_$(vDate).TXT]

(txt, utf8, embedded labels, delimiter is ',', msq);

View solution in original post

2 Replies
sunny_talwar

May be like this:

LET vDate = Date(Today(), 'YYYY.MM.DD');

LOAD [Agent Code],

    [Agent Name],

    [Curr Rep Type]

   

FROM

[\\FILE_LOCATION\NEW_AGENT_$(vDate).TXT]

(txt, utf8, embedded labels, delimiter is ',', msq);

Anonymous
Not applicable

you can define a variable

Let vtoday=date(today(),'YYYY.MM.DD');

and the use

load

..

FROM

[\\FILE_LOCATION\NEW_AGENT_$(vtoday).TXT]

(txt, utf8, embedded labels, delimiter is ',', msq);