Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
ALTER.NEXT:

Join us on Dec 2 for a half-day virtual analytics + data science event!
US & CA customers only

SAVE YOUR SPOT
It's the most wonderful time of the year - Santalytics 2020 is here! This year, Santa's workshop needs the help of the Alteryx Community to help get back on track, so head over to the Group Hub for all the info to get started!

How I get new information for each id and product

Highlighted
6 - Meteoroid

I have two tables and I want add information to the "Table 1":

IDProductFeature
100Product 1Feature 222
200Product 1Feature 555
200Product 2Feature 444
300Product 3Feature 666

 

Table 2:

ProductFeature
Product 1Feature 222
Product 1Feature 555
Product 1Feature 777
Product 2Feature 444
Product 2Feature 888
Product 3Feature 666

 

Result: 

IDProductFeature
100Product 1Feature 222
100Product 1Feature 555
100Product 1Feature 777
200Product 1Feature 222
200Product 1Feature 555
200Product 1Feature 777
200Product 2Feature 444
200Product 2Feature 888
300Product 3Feature 666

 

Thanks

Nina

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

Hi @Ninjago, any time you are looking to lookup one table in another, think of join as a tool in your approach. I have created a sample solution that joins the two dataset you provided.

 

Let us know if this resolves your query. 

Highlighted
6 - Meteoroid

Thanks for the previous post it helped until a certain point until a new problem came up.

 

Table 1:

IDProductFeatureForced
100Product 1Feature 222True
200Product 1Feature 555True
200Product 2Feature 444False

 

Table 2:

ProductFeature
Product 1Feature 222
Product 1Feature 555
Product 1Feature 777
Product 2Feature 444
Product 2Feature 888

 

Result (The model now records one value in the Forced field. Each ID has its own value in the Forced field (True / False) and the value of the Forced field of products added to the ID is always False.): 

IDProductFeatureForced
100Product 1Feature 222True
100Product 1Feature 555False
100Product 1Feature 777False
200Product 1Feature 222False
200Product 1Feature 555True
200Product 1Feature 777True
200Product 2Feature 444False
200Product 2Feature 888True

 

Thanks

Nina

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

Hi @Ninjago,

 

You could use this method which uses an IF function to get your output:

 

image.png

 

If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.

 

Regards,

Jonathan

Highlighted
6 - Meteoroid

Both option now have the problem of omitting a row whose "Feature" row is in Table 1, but is not found in Table 2. Those lines are not included in the result. They should stay in the data.

 

IF [Forced] = 'True'
THEN IF [Feature] = [Right_Feature] THEN [Forced] ELSE 'False' ENDIF
ELSEIF [Forced] = 'False'
THEN IF [Feature] = [Right_Feature] THEN [Forced]
ELSE 'False' ENDIF
ELSE "" ENDIF

 

 

We are very close solver the this problem....

 

Thanks

Nina

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

Hi @Ninjago,

 

How about the attached version? I've unioned after the join to create a left outer join (include all lines in the left table and matching records from the right table)

 

If this solves your issue please mark the answer as correct, if not let me know!

 

Regards,

Jonathan

 

 

Highlighted
6 - Meteoroid

It doesn´t work yet. Take off from Table 2 next row: Product 2 - Feature 444, then you see what happen. I took Unions 1 and 2, that's ok.

 

Thanks

Nina

Highlighted
6 - Meteoroid

Hi!

 

Would anyone find a solution to this problem?

 

Thanks

Nina

Labels