We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

conditionally copying cells to cells and additionally displaying source afterwards

dwstada
11 - Bolide

Hey everyone, I am very new to Alteryx and am encountering a problem I can't solve yet.

 

Basically, I have non-unique IDs, non-unique letter codes, and dates. Some date cells are a default nonsense 19000101 or just 00000000.

I would like to conditionally copy some dates into other cells and then show where the data was copied from, as shown in the tables below.

 

So if an ID has several different codes and only one date other than 19000101 and 00000000, then I want to copy that date into the date cell of the corresponding id + code and add another column indicating where the information was copied from.

And:

If an ID has the same code with several dates, I want to copy the earliest date (other than 19000101 and 00000000) into the date cell of the corresponding id + code and add another column indicating where the information was copied from.

 

My first thought was the summarize tool after changing 19000101 and 00000000 to NULL and displaying minimum of a date, but I don't know how to add a "data copied from" source column that way and it wouldn't work for IDs with different codes and only one date.

 

Is there an easy way to do any of this, maybe with the formula tool?

 

Thank you in advance

 

input

IDCODEDATE
ID1XX1date1
ID2XX100000000
ID2XX2date2
ID2XX319000101
ID3XX2date3
ID4XX2date4
ID4XX3date5
ID5XX1date6
ID5XX1date7 (later than date6)
ID5XX400000000

 

output

IDCODEDATESOURCE
ID1XX1date1 
ID2XX1date2"date from ID2 XX2"
ID2XX2date2 
ID2XX3date2"date from ID2 XX2"
ID3XX2date3 
ID4XX2date4 
ID4XX3date5 
ID5XX1date6 
ID5XX1date6"min date from ID5 XX1"
ID5XX4date6"date from ID5 XX1"
3 REPLIES 3
bkurt
8 - Asteroid

You can use the find replace function for this. 

Filter out the rows with 00000000 and 19000101

then connect the two files with find replace based on ID to change the date.

Emmanuel_G
13 - Pulsar

@dwstada 

 

Find in attachement the way of doing that.

 

I did a test with dummy values of real dates.

 

Please let me know if this solution is ok.

 

Emmanuel_G_0-1666003548218.png

 

 

 

dwstada
11 - Bolide

@Emmanuel_G thank you, this is great

Labels
Top Solution Authors