Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Join while ignoring nulls in secondary table

Abhishek_Gupta
6 - Meteoroid

I have a primary table and a secondary table. I need to join the primary table with secondary table to obtain the value of SKU in Primary table. But I want to ignore the join condition for columns for where it  null in secondary table,i.e. if there is null in a certain column there could be any other value in the primary table for that particular column.

 

I know that this could be achieved using "IIF" in formula tool, but in that case I will have to code each and every row from the secondary table into the formula. And I am having more than 150 rows in the secondary table. Is there any way to achieve the same using a join or something else?

 

Below are the example for the same:

 

Primary Table

Brand Sub BrandProductAdditionalSKU
b1sb1p1sdf 
b2sb2 sdf 
b3sb3p2sdf 
b4 p3sdf 
b5  sdf 
b6 p4sdf 
  p5sdf 
  p6sdf 
 b7 p7sdf 

 

Secondary Table

Brand Sub BrandProdcuctSKU
b1sb1 1
b2sb2 2
b3sb3 3
b4  4
b5  5
  p46
  p57
  p68

 

Join Result

Brand Sub BrandProductAdditionalSKU
b1sb1p1sdf1
b2sb2 sdf2
b3sb3p2sdf3
b4 p3sdf4
b5  sdf5
b6 p4sdf6
  p5sdf7
  p6sdf8
b7 p7sdf 
4 REPLIES 4
patrick_digan
17 - Castor
17 - Castor

@Abhishek_Gupta If you have a set number of columns, perhaps the attached could work for you. I just tried joining on brand first, then sub brand, then product. By unioning all the results, I got the desired result. Perhaps your actual situation is more complicated and won't work for this method.

jrgo
14 - Magnetar

@Abhishek_Gupta,

 

Here's one more option should you still be looking for others...

image.png

Abhishek_Gupta
6 - Meteoroid

@patrick_digan Thanks for the help...But I guess this would become a very complicated solution in my original situation.

Abhishek_Gupta
6 - Meteoroid

@jrgo This one is a nice solution. Although I achieved the task by using "Conditional statements(IF then)". But I will use this approach in my next task. Thank you  

Labels
Top Solution Authors