Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I have a column that having Filenames. My issue is when i load that field into qlikview, i want to restrict some files based on the file extensions(eg: .jpg, .jpeg..). How can i do this?
Please help me on this issue.
Thanks
Maybe using a WHERE clause with a match condition:
LOAD
Filenames
FROM Table.xls WHERE match(right(Filenames,4),'.jpg','jpeg','.png');
or
..WHERE match(subfield(Filenames,'.',-1),'jpg','jpeg','png');
Here you are loading the files based on extensions, but i want to restrict those files into qlikview
Man then only add those extension in where clause which you want
Hi Pradeep,
You can use SubField function there. I am including a sample code that may help you.
IMG_LOAD:
LOAD ID, FILE_NAME INLINE [
ID, FILE_NAME
2, test.jpg
3, test.jpeg
4, no.png
5, yes.png
6, khan.bmp
7, key.jpg
]
where match(SubField(FILE_NAME, '.', -1),'jpg');
And for not loading some file name with extension you can use below WHERE clause:
where if(match(SubField(FILE_NAME, '.', -1),'jpg','jpeg'),0,1);
It'll load the records which contain neither jpg nor jpeg