Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Finding new and removed entries in different versions of list defined by date

andreasledet
7 - Meteor

Hi there,

 

I have a feeling this will either be very challenging or very easy... But I have had no luck trying different ideas and can't seem to find a question like this on this forum. 

So here goes: 

 

I have a database with a number of different lists of the same type and layout. This database is updated daily with new versions of the lists appended to the bottom. 

 

What I'm trying to do is generate a table that shows new entries or removed entries on these lists. 

 

Here's an example of the database (the real one has between 50 and 100 entries on each list version, with 9 lists in total - so about 6-700 rows per day):

 

List namePositionNameDate
Berlin1John2018-11-10
Berlin2Jack2018-11-10
Berlin3Anna2018-11-10
Berlin4Lena2018-11-10
London1Cole2018-11-10
London2Julia2018-11-10
London3Dean2018-11-10
Berlin1John2018-11-11
Berlin2Fred2018-11-11
Berlin3Anna2018-11-11
Berlin4Lena2018-11-11
London1Cole2018-11-11
London2Julia2018-11-11
London3Dean2018-11-11
London4Tina2018-11-11
London5Eric2018-11-11

 

So for this one, between the two dates, Jack is removed from the Berlin list while Fred is added, and Tina and Eric are added to the London list. 

I imagine the output could look something like this - but not necessarily exactly like this:

 

ActionNameDateList
RemoveJack2018-11-11Berlin
AddFred2018-11-11Berlin
AddTina2018-11-11London
AddEric2018-11-11London

 

The length of the lists vary, as well as the frequency of how often they change. Some change daily, some weekly, some hardly ever change. But there is a version of each list for each date, even if there was no change to a list.

 

Thanks in advance!

4 REPLIES 4
jdunkerley79
ACE Emeritus
ACE Emeritus

I'm probably over complicating this but I would do the following.

 

2018-11-22_18-04-03.png

 

Make a set on unique days

Sort this and produce a new column of PrevDate using a MultiRow tool

Add Prev Date to the original data set

Join the data set to itself with PrevDate = Date 

The Left output will be Adds, the Right output will be Removes.

 

A little additional tidying to remove the first and last dates where additional data appears

yalmar_m
11 - Bolide

Hi @andreasledet,

 

This might help, and maybe it's less complicated that @jdunkerley79's solution!

 

Best,

Yalmar

jdunkerley79
ACE Emeritus
ACE Emeritus

@yalmar_m, you're right I over complicated it.

 

2018-11-22_20-37-42.png

 

- Again get set of dates

- Compute Prev and Next

- Join to original Set

- Use a multi-row to see when Prev/Next does not equal previous or next within each Item Name and Name and compute Add/Remove

 

This deals with first and last rows for free as well

 

andreasledet
7 - Meteor

This was exactly what I needed. Thank you!

Labels