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: 
VijayTalend
Contributor
Contributor

Hierarchical mapper - if then else condition maintaining loop

Hi,

I have to map EDI file to Text file. I am getting issue in mapping using Hierarchical mapper.

I am getting below error "Change loop Specification" -

 

The output map element: /root/Loop-NP17/NP34/Starttidspunkt_for_fapportperiode

is already looping using: in$/Transaction-SLSRPT/Loop-UNB/Loop-UNH/Loop-S005 (SimpleLoop)

which is not compatible with: in$/Transaction-SLSRPT/Loop-UNB/Loop-UNH/Loop-S005/DTM

Do you want to change the output map element looping?

 

Can anyone help me in this issue fix.

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

I'm afraid I can't tell you how to fix this using a variable. I would have to use an element of trial and error on this even if I had your data. My suggestion is to go back to try using the IF condition that you tried, but change the outputs to true or false. The errors you had trying that were because you were not outputting true or false.

View solution in original post

15 Replies
Anonymous
Not applicable

Can you share a screenshot of your map? Also, is this error caused by adding the IFThenElse function?

VijayTalend
Contributor
Contributor
Author

Hi,

Thanks for your reply. I have attached map screenshot.

I have progressed in map output.

Now ,the issue is I am getting NULL values too in output,which I do not want. Can you please let me know how to remove NULL values from output.

 

like output is coming as -

NP34
NP34
NP34 201910012300201910022300

 

But I want output only asNP34 201910012300201910022300

 

Please suggest.


Map_1.JPG
VijayTalend
Contributor
Contributor
Author

attached output file which is currently coming.


Map_2.JPG
Anonymous
Not applicable

Do you get the looping on this field if you remove the IF condition?

VijayTalend
Contributor
Contributor
Author

yes, get the looping on this field if you remove the IF condition.

 

I only want the fields where source field is 51 or 52. Others are coming as NULL now, but we do not want to come those as NULL too.

Anonymous
Not applicable

It's really difficult to think about this without having access to the actual mapper. But have you tried using the EMIT tab? This should help you conditionally remove the field.

VijayTalend
Contributor
Contributor
Author

Hi,

 

Thanks for your replies.

 

I tried emit tab. but my target node NP34 requires a Null value coming to source to Emit. But, I have condition to check 51 or 52 value,otherwise its giving null value as output.

 

How to put these condition in Emit. Can you please try to give any example in screenshot from talend studio. The example should check all values of incoming node and emit only values like 51,52 or any other constant.

 

One of the error I am getting while emit usage is -

Overall: Error
1: Error - The referenced map element loops but there is no looping function that specifies how to handle this loop. (222) (INPUT)
Expression: Emit
Referenced Element : Map: Maps/SLSRPT_Recognition.xml - Map Element: in$/Transaction-SLSRPT/Loop-UNB/Loop-UNH/Loop-S005/DTM
Enclosing [Map] Element : Map: Maps/SLSRPT_Recognition.xml - Map Element: out$/root/Loop-NP17/NP34

 

 

Anonymous
Not applicable

First of all, the values that are being returned (which aren't null) are they the correct aggregate values? If this is the case, you should be able to apply the same logic in your EMIT logic. Alternatively you could try setting a variable with this aggregate logic and checking the variable value to see if it is null or holds a value.

VijayTalend
Contributor
Contributor
Author

Hi,

Thanks for your reply.

 

If i copy the same logic in NP34 node in emit, I am getting error. Error attached in Map_3.jpg

 

regarding variable, can you please let me know how and where can I create variable and access it in Hierarchical mapper.


Map_3.JPG