Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I would like to load the table files to QV, to view them there. The source producing those files does not add the important for me dimensions like month and country name. We have 12 months and I get the files for 3 countries (Poland, Hungary and Slovakia). i would like to name those files so that I could know what month and country they contain, so for instance for Jan, Poland, I would use 01_PL.xls, for Aug and Hungary, i would have 08_HU.xls
I was thinking to use 2 first digits of the loading file name and 2 last as content for month and Country dimensions for the data of the given file loaded. This way by small effort I would get 2 very important dimensions...
Could you help me to have something like that?
Thanks a lot in advance
//Draszor
You can use a wildcard in the file from spec like this:
FROM *.xls
And then use the FileBasename() function in your LOAD like this:
LOAD
*,
subfield(FileBasename(),'_',1) as Month,
subfield(FileBasename(),'_',2) as Country
...
-Rob
You can use a wildcard in the file from spec like this:
FROM *.xls
And then use the FileBasename() function in your LOAD like this:
LOAD
*,
subfield(FileBasename(),'_',1) as Month,
subfield(FileBasename(),'_',2) as Country
...
-Rob
Dear Rob,
Thanks a lot, this works perfectly!