community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Join between different criteria

Highlighted
Meteor

hey all :)

 

i have a very important question for our company. i have to make a join betwenn an excel sheet and data from an API. the join is made by two columns -> "siteName" and "groupName". Now the problem is that "siteName" and "groupName" are not always given from the API, but then an "ID" is given, which i can match with an other excel sheet, because there also an "ID" is given. So in this case, a join with the column "ID" is possible.

 

Now the Problem: how can i make it possible to join either "sitename" and "groupname" or "ID"? So, if no join by sitename and groupname is possible, a join by the column ID should be done.

 

is that possible? do i have two make two different joins and then a union? i have absolutely no idea.

 

EDIT: it is also possible that all colums for the join (grouName,siteName or ID) are in one Excel sheet

 

Thank you very much! :)

Alteryx Certified Partner
Alteryx Certified Partner

@Marek89 ,

 

How about thinking like this:  if no join by sitename and groupname is possible, a join by the column ID should be done.

 

First JOIN on SITENAME then connect the LEFT (unjoined) an the RIGHT (unjoined) data into another JOIN tool and attempt on groupname.  Then take the JOIN results from <sitename> and UNION the JOIN results from <groupname> together.

 

2 joins and then a union (your own thought) is the answer.  you did have an absolutely valid idea.  give yourself some credit.

 

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Meteor

thank you :)

 

i had an other idea. it is just about the left (unjoined) data, where no join between "siteName" and "groupName" is possible. with this left part i can make an other join with the Excel sheet by the column id. and then i Can Union this two joins, right?

 

but now the Problem is that if i make it that way, i get this error message in the formula tool (see Screen), which i did not have before the Union tool

Screen1.jpg

 

 

Alteryx Certified Partner
Alteryx Certified Partner

@Marek89,

 

I'd have to see your data to show you the reason why the UNION (may be) is converting one of your variables from a numeric data type to a string.  I'd look at the data types for the fields in the formula and trace the data to see what is happening.  The data type switch from string to numeric may create zero values which could be problematic.

 

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Meteor

i think i found the problem. in the left (unjoined) part the data type for "MN2" is "double" (this were changed in the join tool - from "v_w_string" to "double"), but if i connect this left (unjoined) part to the second join-tool, the data-type turns to the original "v__w_string". is this normal? why the changed data type will not be saved, just because i connect it to a new join tool? thank you :)

Labels