Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

compare Directory files with table files

I am trying to find out if files that are listed in directory exists in ms sql server table.
 Please help.

Labels (2)
6 Replies
Anonymous
Not applicable
Author

Please help me with this question. I really need to complete this.
Thanks
Anonymous
Not applicable
Author

1. Iterate each file with tFileList and merge all the file name.
2. Read all the file names from database. 
3. Do an inner join on tMap and generate two outputs, one for existing files, another one for non existing file. 
The job looks like:
tFileList--iterate--tFixedFlowInput--main--tUnite--tMap---
                                                                           |
                                                                    tMssqlInput
on tFixedFlowInput: define one column called filename and set its value as:
((String)globalMap.get("tFileList_1_CURRENT_FILE"))

Please refers to this article to learn how to do an inner join on tMap.
Anonymous
Not applicable
Author

This solution worked perfect. Now I'm trying to put all the filename into variable from tMap.please help.
Anonymous
Not applicable
Author

Now I'm trying to put all the filename into variable from tMap.please help.

Hi 
I don't understand what you want to do? Can you please explain it with more details?
Anonymous
Not applicable
Author

tMap has a column called 'FileName'.
Currently I am printing tMap filenames on the screen using tLogRow.
I want to collect all the filenames and put it into a variable for later use.
Thanks,
Anonymous
Not applicable
Author

Hi
You can add all the filenames to a list or append it to a string on tJavaFlex, eg:
...tMap--out1--tJavaFlex

begin part of tJavaFlex, define a lst:
java.util.List list=new java.util.ArrayList();

main part: add each filename to the list:
list.add(out1.filename);

end part: put the list to a global variable for used later:
globalMap.put("list",list);

In the next subjob, you can get the list from the global variable with this expression:
(java.util.List)globalMap.get("list")