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
Solved! Go to Solution.
Cross join without using the append tool:
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)
Create join field on both inputs as:
"J"
join in that field.
cheers,
mark
If you just want to duplicate each month four times then you could use the Generate Rows tool,
just out of curiosity... why not use Append Fields if it's the tool made for cross join?
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.
@stj1120 , I would do the same as @Christina_H . Create a "fake" key and use Join Tool.