Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I got this statement - that checks part of the filename to decide what column name to use importing from sheet
and save that value into a field with a common name.
However it seems the importer evaluates the existence of BOTH Columns regardless if only one of them is to be used according
to the IF-statement (that does not check column values but the filename to avoid checking for Columns that does not exist)
If(Trim(Left(SubField(FileName(),'Open',2),8)) = 'Changes',[CHG],[INC]) As State,
... the problem is only either one or the other column name exists in each source-file, and import fails on the missing column
even if Iam not actually trying to import it imo.
I thought i could workaround by checking filename and decide what column to import based on that - but it seems I cannot?
Tried it with Qlik Sense, seems to be working well Except for the fact that it doesn't really rename the column name in the front end for some reason. Try it out
Try add a file that is not matching "Change" and you will see it fail.- it will still look for the INC field in the CHG excel file - also....
I did and it works for me without any errors. I will give it a try one more time
Works as I would expect. Try one each time the attached two files. Do not have both of them sitting in the same folder when loading
Now I understand why we dont understand each other 🙂
the problem is just that i want to have these in the same folder at the same time and use the name as a variable to know what columns to load from each file. (in Sense Cloud, there is no folder structure possible)....
Atleast now we do. And are you trying to load both of them or just one of them? and if you will only load one of them, then how would you decide which one to load?
I want to load all files matching my path ie. \somefiles*.xls
I think that is much simpler that what we have been doing thus far. Here are some references while I play around with our current sample
Loading data from multiple xls-files from folder with subfolder
Iam Sorry Sunny T, the examples is just addressing import of multiple files, that I got covered already
The thing is my files differs in format - ie. column names differs from file A to file B - but data there should go to same Sense column, I also want to to different things based on if a column is existing in a sheet or or not.
It does not seem to be a a way to check if a column is there or not - that is the exact functionality Iam after.
so far I worked-around this by some macros excelside to clean and format the data, it however adds
a manual step I would like to get rid off.