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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Lorenzo5
Creator
Creator

tHashInput component: The hash is not initialized

Hi,

 

I well know the reason of this error, of course.

I'm wondering if there are a way to avoid this error simply acting on the tHashInput component.

I explain: in my Job the execution flow does not always reachs the tHashInput component, for some reasons ("if" and different branches followed).

I would like that the subsequent tHashInput component treat this "hash not initialized" like a "hash initialized with zero rows", because the tHashInput is used as lookup-input-link for a tJoin and I would the treat it as "no lookup records available".

 

The only solution that came in my mind is to set-up one more tHashOutput crutch component, initialize it with a zero-row array in input, and then link (taking advantage of "Link with a tHashOutput" feature) my main tHashOutput component to the crutch one.

But this solution make me a bit sad, because in my Job I have 7-8 tHashOutput componentsto for which I should prevent the "hash not initialized" error.

 

tHashInput could have a flag (checkbox) to let it know to treat null hash as existing but empty hash. 

 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

OK, the only way of doing this is to pre-initialise the tHash components then. This is obviously not all that elegant (and I agree would be a great feature to be able to have the tHash components pre-intialised automatically if they are placed on the workspace), but I guess you sometimes have to put up with irritations like this when using a code generation tool. You *could* use a tJavaFlex and create your own data structure using Java (something I sometimes do if I need something special), but I suspect that is not necessary here.

View solution in original post

5 Replies
cterenzi
Specialist
Specialist

I think your "crutch" is a good workaround, and you could initialize it in a prejob, much like you would a database connection. I also agree that an option to automatically initialize a hash or treat an uninitialized hash as empty would be appreciated.
Lorenzo5
Creator
Creator
Author

😞 

my trick is not so satisfactory to me, because as I told I have to put one more tHashOutput component for each of my existing one. And since my job is based on uncouple few flow branches with Hash components, this trick makes my Job quite full of stuff 😞

 

 

Anymore idea?

Anonymous
Not applicable

Your tHashInputs that are linked to tHashOutput components that have not been initialised, I am assuming are the starting points of different subjobs. Is that correct? If so, can you not use RunIf links to link to them? Then in the IF condition use the "Number of line" globalMap variable for the tHashOutput it refers to, in order to work out if it should be used.

Lorenzo5
Creator
Creator
Author

Hi @rhall

no, some of the tHashInput components are in the middle of subjobs (i.e. the supply lookup rows for tJoin components), and those subjobs need to complete.

So, the tHashInput shoud execute, without failing.

Anonymous
Not applicable

OK, the only way of doing this is to pre-initialise the tHash components then. This is obviously not all that elegant (and I agree would be a great feature to be able to have the tHash components pre-intialised automatically if they are placed on the workspace), but I guess you sometimes have to put up with irritations like this when using a code generation tool. You *could* use a tJavaFlex and create your own data structure using Java (something I sometimes do if I need something special), but I suspect that is not necessary here.