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

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE
SOLVED

Compare output data to existing spreadsheet and append if it doesn't exist in spreadsheet

Meteor

There may be a simple solution for this but it's not coming to me at the moment.

 

I need to compare the output data from my workflow to an existing spreadsheet.  If the row of data does not exist in that spreadsheet I need to append it.

 

For Example:

 

Here's my output data:

ItemColorSize
ShirtWhite

XS

ShirtWhite

S

ShirtWhite

M

ShirtRed

L

ShirtWhite

L

ShirtWhite

XL

 

And Here's the data in my existing spreadsheet:

ItemColorSize
ShirtWhite

XS

ShirtWhite

S

ShirtWhite

M

ShirtWhite

L

ShirtWhite

XL

 

I need to append the row that does not exist in the spreadsheet to the end of the spreadsheet.  So my spreadsheet looks like this at the end:

 

ItemColorSize
ShirtWhite

XS

ShirtWhite

S

ShirtWhite

M

ShirtWhite

L

ShirtWhite

XL

ShirtRed

L

 

Alteryx Partner

Hi,

 

You can just Join the output data and the data from the existing workflow by the three fields. Depending on how you connect to the Join either the L or R output will be the rows that are not in the Spreadsheet.

 

You can then write those records to the spreadsheet and use the "Append to Existing Sheet" option within the Output data tool.

 

Cheers,

Bob

 

Join.png

Alteryx Certified Partner
Alteryx Certified Partner

Is there a "KEY" on the transactions?

Alteryx ACE & Top Community Contributor

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

@Bob_Blackey wrote:

Hi,

 

You can just Join the output data and the data from the existing workflow by the three fields. Depending on how you connect to the Join either the L or R output will be the rows that are not in the Spreadsheet.

 

You can then write those records to the spreadsheet and use the "Append to Existing Sheet" option within the Output data tool.

 

Cheers,

Bob

 

Join.png


 

Ah I realize my mistake now.  This was my original approach but I was expecting 14 records in the left output, however, I was getting 759 on the left, and 745 on the right.  I couldn't understand why those 14 were getting lost!

 

This morning I realized that both tables contain 8 fields, and I was only joining on 7.  Your workflow and a fresh set of eyes helped me catch this.

 

@Thank you very much @Bob_Blackey !!!

Alteryx Partner

Glad to help, a second set of eyes is often one of the most powerful tools!

 

Bob

 

Labels