Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello-
I am trying to load multiple .xlsx files from my computer, and use the file names as a field inside of Qlik.
I need help writing the script.
Claim '....GD-01' has an open and closed (CL & OP) claim status. The reasoning in loading the file name as a field would be for users to select what file date they want for history purposes.
I am adding an excel master calendar to the script. Is that a reason to not use the Year Month you mentioned?
Sunny,
of course you're right, and I never said you couldn't accomplish the same result using FileBaseName(). (sorry about the reassignment, to me the original was perfectly ok).
Call it a nerd habit, but I always keep thinking about performance impact. Even a tiny one, like in this case. Lets compare it to how we would implement those file functions using the subfield() call. Given a full path, Filename would need a single call, while FileBaseName would need at least two. Multiplied by the number of different columns (I don't think the script engine caches the result from static calls between column creation expressions or inside a loop, but I'm not really sure) .And for no reason if you just want your specific part of the filename.
I may be nitpicking here, as the difference doesn't amount to much if you're not reading millions of lines from thousands of files.
Peter
I just added the master calendar, and I see syn keys.
Sorry about the reassignment
No apologizes needed, I find your responses as a way to learn new things.
Call it a nerd habit, but I always keep thinking about performance impact. Even a tiny one, like in this case. Lets compare it to how we would implement those file functions using the subfield() call. Given a full path, Filename would need a single call, while FileBaseName would need at least two. Multiplied by the number of different columns (I don't think the script engine caches the result from static calls between column creation expressions or inside a loop, but I'm not really sure) .And for no reason if you just want your specific part of the filename.
So there are performance benefits here, even though they might be very slight. Is there a resource where I can read about this (and other similar performance stories?)
I don't know you data well enough to give any insights, but if you don't want to join your table on date and month fields, then don't create them