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
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 can't use append, you could create a joining field with the same value in each row:
If you just want to duplicate each month four times then you could use the Generate Rows tool,
@stj1120 , I would do the same as @Christina_H . Create a "fake" key and use Join Tool.
@stj1120
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.
You may have more than 16 records in the source, and the append tool will over-generate, creating massive duplicative records. In those situations, you can use a formula tool on each dataset to create a new field named dummy_key and use it to connect the datasets to a join tool.