Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I don' t seem to find the answer to this.
I want to load multiple CSV files, in which the columns are named, but some of them miss some columns
Ex.
file 1 to n have columns (a,b,c,d)
file n+1 to p have columns (a,b,c,d,e)
if my load scripts tries to read column 'e' I get an error for files 1 to n.
How can I prevent this?
Thanks in advance
set concat='';
for Each file in FileList('*.csv')
table:
$(concat)
load *, '$(file)' as filename
from $(file);
set concat=' concatenate (table) ';
NEXT;
you can take a look at here. A file checker utility for file based data sources
Thank you, I get your idea, but this seems an overkill for my case.
Is there really no way in Qlikview load scripts to do something like this
LOAD
a as [field a],
b as [field b],
c as [field c],
d as [field d],
if (e exists, e, null) as [field d]
...
I think load * from files can work. try it.
Try this one . Its helpful for you.
let vs='File n+1';
FOR Each vs in 'Fil 1','File n+1';
LOAD *
FROM
(biff, embedded labels, table is $(vs));
NEXT vs;
set concat='';
for Each file in FileList('*.csv')
table:
$(concat)
load *, '$(file)' as filename
from $(file);
set concat=' concatenate (table) ';
NEXT;
There is no way inside from a load to check if fields are existing or not. The easiest way would be the suggestions below from maxgro- use it, it's easy.
- Marcus
it is not possible .
This is probably it.
Have you checked the solution which had maxgro suggested above?