Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
gerhardl
Creator II
Creator II

Load from latest date's folder

Hi,

Our system generated reports every day, and then sends ot to a folder called "Einstein Reports".

If I open this folder there will be folders for every year, in such a folder will be folders for every month and in such a folder will be folders for every day.

So the last day of June will be        L:\Einstein Folders\2011\062011\30062011

And the next day will be                 L:\Einstein Folders\2011\072011\01072011

In many of my QV files I use the latest day's extracts. Usually I copy the files to my local drive and then use a FROM statement something like . Some files I concatenate daily and others I replace daily.

What I would like to know is how I can, in my FROM statement, automatically have the script look at the LATEST day's folder so I can just open and reload my QlikView apps without having to do anything manually.

Example:

Account Extract:     ***I replace this file every day

LOAD [1],

          [2]

FROM

Transaction Extract:        ***I Concatenate every daily file

CONCATENATE LOAD [1],

                         [2],

FROM [

         

Thanks,

Gerhard

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

  Create two variables which will store the latest month and current day.

  Like this,

  Let LMonth = Date(Today(),'MMYYYY');

   Let LDay = Date(Today(),'DDMMYYYY');

  Load [1],[2]

   From

  'L:\Einstein Reports\2011\'& $(LMonth)& '\'& $(LDay) &'\Daily_Transaction_Extract_*.txt'

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

2 Replies
Not applicable

Hi,

You just need to define a parameter which you then use in the from:

Set Path = 'L:\Einstein Reports\2011\' & Year(tpday()) & month(today()) &' \' & Year(tpday()) & month(today()) & '\

Daily_Transaction_Extract_*.txt';

Load

[1],

          [2]

FROM $('Path');

Regards,

Jonathan

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

  Create two variables which will store the latest month and current day.

  Like this,

  Let LMonth = Date(Today(),'MMYYYY');

   Let LDay = Date(Today(),'DDMMYYYY');

  Load [1],[2]

   From

  'L:\Einstein Reports\2011\'& $(LMonth)& '\'& $(LDay) &'\Daily_Transaction_Extract_*.txt'

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!