Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
SOLVED

Cartesian / cross join without using append join.

sreenivasateja
8 - Asteroid

Hi all,

 

I have two inputs and I need to do cross join without using a append tool. How it is done?

 

I tried using Tile tool by applying Equal Records but no luck. Output is shown in the workflow.

 

Please check and help.

 

Best Regards,

Teja

8 REPLIES 8
PhilipMannering
14 - Magnetar
14 - Magnetar

Cross join without using the append tool:

PhilipMannering_0-1636113352700.png

 

PhilipMannering
14 - Magnetar
14 - Magnetar

Here's the code for a copy and paste

import pandas as pd

from ayx import Alteryx
from itertools import product

list1 = Alteryx.read('#1').iloc[:,0]
list2 = Alteryx.read('#2').iloc[:,0]

Alteryx.write(pd.DataFrame(product(list1,list2)), 1)
MarqueeCrew
19 - Altair
19 - Altair

Create join field on both inputs as:

 

"J"

 

 join in that field. 

cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Please Subscribe to my youTube channel.
Christina_H
11 - Bolide

If you can't use append, you could create a joining field with the same value in each row:

Christina_Hurrell_0-1636113881311.png

 

PhilipMannering
14 - Magnetar
14 - Magnetar

If you just want to duplicate each month four times then you could use the Generate Rows tool,

PhilipMannering_0-1636113914554.png

 

AZuc
Alteryx
Alteryx

@sreenivasateja 

 

just out of curiosity... why not use Append Fields if it's the tool made for cross join?

André Zuccatti

Sales Engineer - LATAM -
Alteryx, Inc.


sreenivasateja
8 - Asteroid

Hi @AZuc 

 

Yes, I kow the use of Append Tool. Just wanted to try and know if we can achieve cross join results without using Append tool. 

 

Kindly let me know how to achieve it. 

 

Thank you.

 

Teja. 

AZuc
Alteryx
Alteryx

@sreenivasateja , I would do the same as @Christina_H . Create a "fake" key and use Join Tool.

André Zuccatti

Sales Engineer - LATAM -
Alteryx, Inc.


Labels