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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Issue in tmap

Hello!

I have one mapping issue. The issue goes like:

I have a fact table: 

fact idElement_idB_type
123.A01-01-PV15
223.A02-01-PV15
323.A03-01-PV20

Then I have a rule table like: 

Rule idfilter element idFilter B_type
123.A15
223.A0115
323.A02-01-PV15

I want to create an X-ref table between both of them. For this I need to comapre the pattern in rule table and use the Filter B_type.

Final Output:

fact idRule id
11
12
21
23

To comapre the strings, I broke element_id in both the tables in TMap like following

Fact Table:

Element_idBdelGroupUndergroupLNOComponent
23.A01-01-PV23A0101PV
23.A02-01-PV23A0201PV
23.A03-01-PV23A0301PV

Rule Table:

filter element idBdelGroupUndergroupLNOComponent
23.A23NullNullNull
23.A012301NullNull
23.A02-01-PV230201PV

Unfortunately now I am stuck. I dont know how to comapre these two in TMap to produce the Final output mentioned above.

How can I do it?

 

Regards

Priyadarshini

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi Priya,

 

    I hope the below solution will help you (Note:- In your sample output, you did not mention the combination for fact_id 3. I hope it was accidental)

 

0683p000009M5N2.png

 

Please refer the tMap details below.

 

0683p000009M5N7.png

 

row3.element_id.contains(row4.filter_element_id)

On a lighter note, I hope your team members looking for regular expression won't complain this time 0683p000009MAB6.png

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

 

 

 

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Hi Priya,

 

    I hope the below solution will help you (Note:- In your sample output, you did not mention the combination for fact_id 3. I hope it was accidental)

 

0683p000009M5N2.png

 

Please refer the tMap details below.

 

0683p000009M5N7.png

 

row3.element_id.contains(row4.filter_element_id)

On a lighter note, I hope your team members looking for regular expression won't complain this time 0683p000009MAB6.png

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

 

 

 

Anonymous
Not applicable
Author

Hello @nthampi !

Thank you so much for your reply. The solution works but fails when I add a condition. As you can see in the example, there is one more filter called Filter B_TYPE. So in the expression filter, I added this 

row3.element_id.contains(row4_Element.FILTER_ELEMENT_ID) && row3.type.equals( row4_Element.FILTER_B_TYPE). Is it not correct?

 

Regards

Priya

Anonymous
Not applicable
Author

Hi,

 

   It worked fine for me!

0683p000009M5PI.png

 

0683p000009M5PN.png

 

row1.Element_id.contains(row2.filter_element_id) && row1.B_type.equals( row2.Filter_B_type)

Please check whether you are adding variables in right case. That could be the reason.

 

We have resolved both your original and supplementary query now 🙂 If all looks fine, please spare a second to mark the topic as resolved.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

 

 

Anonymous
Not applicable
Author

Hello @nthampi 

Thank you for your reply. 0683p000009MACn.png

 

Regards

Priya