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: 
Not applicable

Merge the file with different name

Hi,

I have a batch of files in CSV format loaded in local directory with different file name(eg. Salesdaily02062017.CSV and Salesmonthly052017.CSV). Data in all the file is same only the changes in the naming convention(daily & monthly with different timestamp).

On regular basis i receive one daily file, during monthend i receive two files i.e. one daily and one monthly. I am looking for merge daily and monthly files together into QVD and set a variable when the monthly data processed into QVD.

Could you please help me in this case.

Regards,

Rohit

1 Reply
marcus_sommer

Maybe something like this:

Sales:

load

     *,

     if(index(filebasename(), 'monthly'), 'monthly', 'daily') as Type,

     date(alt(date#(keepchar(filebasename(), '0123456789'), 'MMYYYY'),

                  date#(keepchar(filebasename(), '0123456789'), 'DDMMYYYY'))) as Date

from Sales*.csv (txt);

store Sales into Sales.qvd (qvd);

- Marcus