Alteryx Designer Desktop Discussions

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

Display differences between 2 string columns

HenpetsGordres1
8 - Asteroid

Hello,

 

Could someone please assist with this issue. I would like to compare and display the difference between two string columns in two new columns, example:

 

If I had the following two columns:

 

Column1Column2
Day: 16
Month: November
Year: 2018/2019
Day: 16
Month: November
Year: 2019/2020

 

I would like the output to be the following:

 

Column1Column2Difference - Column1Difference - Column2
Day: 16
Month: November
Year: 2018/2019
Day: 16
Month: November
Year: 2019/2020
2018/20192019/2020

 

Is this possible?

 

Many thanks

6 REPLIES 6
MarqueeCrew
20 - Arcturus
20 - Arcturus

@HenpetsGordres1 ,

 

A clarifying question for you:  The cells contain embedded new lines.  Are you requesting that the output include these embedded new lines too?  It would seem that you could first modify the input to individual records.  

 

The expected output also looks suspect.  While both columns have "Month: November", you want the difference to be the value of year.

 

If you try the CReW Delta macro:  https://gallery.alteryx.com/#!app/CReW-Delta--Alpha-/5b41141b826fd3116445fee8 I think that you'll get your desired results.

 

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
HenpetsGordres1
8 - Asteroid

Hi Mark,

 

Many thanks for your response, to clarify the attached excel was dummy data to try and simplify my issue. I do need to retain the embedded lines as I am comparing variables within 2 XML documents. I have attempted to use the macro but rather than identifying the actual differences, it gave me the following:

 

HenpetsGordres1_0-1588252216168.png

 

Ideally I would have 2 columns as depicted in my desired outcome. Apologies if I have understood the Macro incorrectly. I'm also not sure what is suspect about the requested output, the difference between the columns is the value which follows "year:"

 

HenpetsGordres1_1-1588252425764.png

 

Many thanks

 

MarqueeCrew
20 - Arcturus
20 - Arcturus

I have a working prototype. I sent you a private message with a link to my ZOOM account. Please come see what I've cooked up for you. This would save some back and forth possibly. At minimum it is a MVP solution. Cheers, Mark

 

P.S.  here it is... 

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
HenpetsGordres1
8 - Asteroid

Hi @MarqueeCrew 

 

Many thanks for taking the time to do this. Due to restrictions on my work issued laptop I cannot access ZOOM, apologies! I've tried via browser too but no joy unfortunately.

MarqueeCrew
20 - Arcturus
20 - Arcturus

I posted the solution.  It creates the output (final browse) and repeats the incoming data with a difference set of columns.  The output includes a CSV list of differences when something is found:

 

,,data and ,,data.

 

When no difference exists, it is blank.

 

It allows for any number of fields to exist for comparison inside of a cell.  It does require the ORDER of fields to be identical.

 

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @HenpetsGordres1,

 

So i think i've found a way for this to be done:

 

I've started with the below input (3 records with 3 new lines in each, one for day, one for month and one for year)

image.png

 

The workflow:

image.png

 

And the output for line 1 is just the year, nothing for line 2 (as the values are exactly the same for day, month and year), line 3 the output is the month and year.

 

Difference - Column1 row 3 output:

image.png

 

Difference - Column2 row 3 output:

image.png

 

If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.

 

Regards,

Jonathan

Labels