Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have an extract that stores a new qvd file in the same directory everyday. The files are called accounts_$(v_todays_date).qvd
Then when I pull the files in the data model my FROM statement is just:
FROM
So it pulls in every file in the directory.
This has worked fine so far since I have not needed to add any fields. However, I am in a situation that I do need to add a field to the files going forward. I am wondering if there is a way to keep my current structure and somehow ignore the fact that there is a new field in some of the qvd files. Like something that I can put in the LOAD that says if the field doesn't exist in one of the qvd files just make it null. Is this possible?
I hate to say it but does just using this work:
Load *
FROM
It depends what you then do with those fields I guess, but you can't be doing much if you're aiming for optimised qvd loads anyway.
Hi,
You can try a loop in your directory like:
MyTable:
Load
*
Inline [
ID
];
for each vfile in filelist("directoryName")
concatenate(MyTable)
Load
*
From $(vfile)(qvd)
;
next vfile
Hmm no that creates a synthetic key... bear with me
Yep this resolves the issue I was having with the synthetic key, and actually you don't even need the loop
transactions:
load * INLINE [
TransCounter
];
concatenate(transactions)
load *
from accounts_*.qvd(qvd);
ah, ok great
What is the purpose of 'TransCounter' in this example? I don't currently have a field like that in my existing qvd files and I am unable to recreate them.
hi Matt,
it can be any field from your QVD at all, just replace it with any one. The load inline is just required to create the table so you can then concatenate it