Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Load files into a table excluding files having timestamp for some years

Hi,

I wanted to load .csv files from a specific path.

In that path the csv file names are ending with a date stamp for ex: XXXX_2014051,XXXX_20130412... and the files are available from 2103 till date

how can I restrict my load so that I wanted to load the files having date stamp only from 2014.

Please assist me on this.

1 Solution

Accepted Solutions
Digvijay_Singh

You can do like this -

LOAD FileName

FROM

[YourPath\TableA.qvd] (qvd) where wildmatch(FileName,'*2014*','*2015*','*2016*')

View solution in original post

7 Replies
SreeniJD
Specialist
Specialist

Hi Tejaswini

You can use SubField() or LEFT() functions to extract "2014" from your string and restrict that in your load..

Try this with Mid function as well...

MID(DATE1,index(DATE1 ,'_' )+1,4) as Year1

Regards,

Sreeni

Digvijay_Singh

You can use For statement like this -

For each vFileName in Filelist('Yourpath\*2014*.csv')

Anonymous
Not applicable
Author

HI,

Thanks for your reply.

I wanted to load files from 2014 onwards

Digvijay_Singh

missed that, you can do like this if you know the last year, I checked, its working -

For i = 4 to 6

  For each vFileName in Filelist('C:\Users\diganjali\OneDrive\Digvijay\BIDW\Qlik BI\Qlikview practice\temp\*201$(i)*.xlsx')

      Load

         '$(vFileName)' as FileName

      From [$(vFileName)];

  Next vFileName;

Next i

Anonymous
Not applicable
Author

Hi,

Thanks for your help.

If all this file names are loaded into QVD only with the filed 'filename' having file names from XXX_2013* to XXX_2015* (till date)

now I wanted to load this qvd into a table having file names only from 2014.

Kindly assist me on this as well.

Digvijay_Singh

You can do like this -

LOAD FileName

FROM

[YourPath\TableA.qvd] (qvd) where wildmatch(FileName,'*2014*','*2015*','*2016*')

Anonymous
Not applicable
Author

Thanks for the help and it working fine for both qvd and files