Skip to main content

Hi,

 

I am trying to accomplish a left outer join in my dataflow and not getting the expected result. I have created two sample datasets like this:

 

Dataset Q: {A, B, C, D}

Dataset P: {(A,r), (A,s), (B,r), (B,s), (C,r), (C,s), (D,r), (D,s)}

 

Doing a left outer join on this in SQL returns the following:

 

Dataset QP: {(A,r), (A,s), (B,r), (B,s), (C,r), (C,s), (D,r), (D,s)}

 

Trying to do the same in my dataflow using an augment transformation (Dataset Q on the left, Dataset P on the right) with the lookup multiple values option returns this:

 

Dataset QP: {(A,(r,s)), (B,(r,s)), (C,(r,s)), (D,(r,s))}

 

Instead of returning multiple rows for multiple matches, it instead creates a multi-value field. Is it possible to get the results of a true left outer join in a dataflow or within an Einstein query so instead of creating a multi-value field, I instead get multiple rows returned per match?

2 commentaires
  1. 4 oct. 2020, 02:56

    Although I am afraid if I could not get you right, let me share my resolution with referring your sample.

    Set Column1 and Column2 which has {A,B,...} and {r, s,..} respectively.

    1. append

    DatasetQ & DatasetP with allowing disjoint schema

    2. ComputeRelative

    Partition by: Column1

    Order by: Column2 asc/desc

    Add a field (SAQL): Flg

     case when ('Column2' is null && previous('Column1') != previous('Column1') && next('Column1) != next('Column1')) || ('Column2' is not null) then "1" else "0" end

    3. Filter

    'Flg'=="1"

    Hope this work correctly in your case.

0/9000