Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

gerhardl
Contributor 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

Tags (1)
1 Solution

Accepted Solutions

Load from latest date's folder

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

2 Replies
Not applicable

Load from latest date's folder

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

Load from latest date's folder

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