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

Announcements
Streamlining user types in Qlik Cloud capacity-based subscriptions: Read the Details
cancel
Showing results for 
Search instead for 
Did you mean: 
PhilHibbs
Creator II
Creator II

Ensuring that a tHashOutput exists

There are a number of cases where I want to create a tHashOutput from, for example, a tFileList or tS3FileList component. The problem with this is, if there are no files then the hash doesn't get created at all, and the tHashInput component fails.

 

Is there a good way around this? The ugly hack that I have at the moment is to have a separate linked tHashOutput that is populated from a tFixedFlowInput via a tFilterRow that drops the row. That creates the hash with zero rows in it, then the tFileList populates it with whatever files it finds if any, and it can be safely used in a tHashInput without falling over if there were no files.

 

I'm not terribly keen on the tFixedFlowInput and tFilterRow, what else could I do?

Labels (2)
2 Replies
Anonymous
Not applicable

If you're trying to avoid an uinitialized hash exception, you can connect the section w/ your hashInput via a runIf connection and check the line count from the hashOutput

 

((Integer)globalMap.get("tHashOutput_1_NB_LINE")) > 0 

Now it should only execute if the hashOutput has data in it

PhilHibbs
Creator II
Creator II
Author

I need it to execute though. I need the hash to be empty. Lets say the tFileList is looking for a list of files to exclude, say files that have already been processed, and I need to do a lookup on that "already done" list.