Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

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

abovino
7 - 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

 

4 REPLIES 4
Bob_Blackey
11 - Bolide

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

MarqueeCrew
20 - Arcturus
20 - Arcturus

Is there a "KEY" on the transactions?

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
abovino
7 - 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 !!!

Bob_Blackey
11 - Bolide

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

 

Bob

 

Labels