Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Load QVD's with different names into 1 table

Dear All,

I need to upload history QVD's. These QVD are stored on adaily base and contain the month/year in the description. I don't see how I can automate this process.

Sample code for 2 months of data:

//load history QVD snapshots

Hist_bedrijf:

load BedrijfLidNummer,

KEY_BedrijfMaand as H_maand

from bedrijfcommunity_200912.qvd(qvd);

load BedrijfLidNummer,

KEY_BedrijfMaand as H_maand

from bedrijfcommunity_200911.qvd(qvd);

.......etc

I would prefer to have a flexible code statement where the QVD name contains a variable.

any suggestions ?

Many thanks,

Erik Pos



1 Solution

Accepted Solutions
Not applicable
Author

Hi,

i think you can do like this

let ForYear = Year(Today());

let ForMonthNo=NUM(Month(Today()));

let initialname='bedrijfcommunity_';

For Var=1 to $(ForMonthNo)

Load * from initialname& $(ForYear )&(Var)&'.qvd';

next

Hope this will help you........

View solution in original post

4 Replies
Not applicable
Author

Hi,

i think you can do like this

let ForYear = Year(Today());

let ForMonthNo=NUM(Month(Today()));

let initialname='bedrijfcommunity_';

For Var=1 to $(ForMonthNo)

Load * from initialname& $(ForYear )&(Var)&'.qvd';

next

Hope this will help you........

Not applicable
Author

You can use the following:

load

NUM#(left(right(filename(),10),6)) as qvd_date,

BedrijfLidNummer,

KEY_BedrijfMaand as H_maand

from bedrijfcommunity_??????.qvd(qvd);

This will load all qvd and generate the month date linked to it.

Rgds,

Sébastien

Not applicable
Author

Hello Rahul,

This solution works already !

thanks Erik

Not applicable
Author

Sebastien,

This solution is even more flexible and works fine.

Thanks Erik