Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
You can do like this -
LOAD FileName
FROM
[YourPath\TableA.qvd] (qvd) where wildmatch(FileName,'*2014*','*2015*','*2016*')
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
You can use For statement like this -
For each vFileName in Filelist('Yourpath\*2014*.csv')
HI,
Thanks for your reply.
I wanted to load files from 2014 onwards
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
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.
You can do like this -
LOAD FileName
FROM
[YourPath\TableA.qvd] (qvd) where wildmatch(FileName,'*2014*','*2015*','*2016*')
Thanks for the help and it working fine for both qvd and files