Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
has anyone found a way to capture the filename as a column when you're importing from a file?
we get daily files that all have the "date" as part of the filename .. i'd love to be able to capture the entire filename (heck even the entire path & filename would be acceptable) so i know exactly which file a record comes from.
i've heard you can do something file preprocessing on the connection, but thats thru powershell, and i dont know that very well.
i cannot believe the filename of all things isnt a parameter that's just captured by default .. Replicate certainly has to know the filename to open it and pull data from it.
If you're working in script level you can use the function FileName to extract the name of the file that is feeding the table:
not sure what you mean .. at a script level .. this is in replicate using "file" as a source .. QlikView has different options i think.
If you're working inside Qliks environment, specifically at the loader script while loading tables.
If you need to extract the file name of a file that is feeding a table you're loading, you can use the above function to do so. If you need to do it outside QlikView or Sense, not really sure then, sorry.
@therealdees - You are replying to a Qlik REPLICATE topic. Not Qlikview - This is a different (more fun) animal!
@Roger_Sheets Check the PRE PROCESSING option in the ADVANCE TAB.
Be sure to read the Userguide many time, very carefully. It's not too hard, but details matter (as always)
Setting up a File Pre-processing Command
Your program will be executed on each of the input files, and should accept the following parameters:
l The location of the input file(s) (as specified in the Location of full load data file(s) and/or the Change
File location)
l The full path of the output file
The output file(s) will be written to the following location:
PRODUCT_INSTALLATION\data\tasks\TASK_NAME\trans_files\OUTPUT_FILE_NAM
Hello @Roger_Sheets ,
I agree with @Heinvandenheuvel , personally I do not think it's easy to get the file name dynamically. How about add the file name as one additional column value(s) by file preprocessing option.
Hope this helps.
John.