Free Trial

Alteryx Designer Desktop Discussions

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

Combining Data on Value and Date

pablomtz28
6 - Meteoroid

Hi all,

 

I have some data that has many information including personal id and a start year. The personal id can be repeated throughout the data, but per personal id, there is only a unique start year, such as this:

 

Data

Personal IDStart Year
00012010
00012011
00022012
00022013

 

I am trying to combine the data so the personal id is not repeated, and I get a range of years per personal id, so end up with something like this:

 

Output

Personal IDYears
00012010-2011
00022012-2013

 

Anyone know how to do this? Is it possible?? Thanks in advance!

6 REPLIES 6
Lyser
5 - Atom

could you use the summarize tool to group by Personal ID, and calculate the MIN and MAX start years?

you could then use the formula tool to create the a field containing the MIN and MAX as a range.

Hi @pablomtz28 

 

Please see below a way to do it.

 

christine_assaad_0-1595004411905.png

christine_assaad_1-1595004426553.png

 

pablomtz28
6 - Meteoroid

Thank you very much, that was very helpful!

 

I have another follow up question, I dont know if you might know the answer to this, as I found a better way to approach this problem I had.

 

I am dealing with the same data, but instead of dealing with ranges as mentioned before, I want to add five new columns that relate to the years 2016-2020 and simply add a boolean per Personal ID to check wether they were a part of the event that year.

 

Input:

 

Personal IDYear
00012016
00012017
00012020
00022018
00022019
00022020

 

Output:

Personal ID20162017201820192020
0001YesYesNoNoYes
0002NoNoYesYesYes

 

Is it possible maybe?? Thanks in advance!

Hi @pablomtz28 

 

Is this what you are looking for?

 

christine_assaad_0-1595007187830.png

christine_assaad_1-1595007207446.png

 

 

pablomtz28
6 - Meteoroid

Hi @

 

I have one quick follow up regarding the previous questions regarding adding columns per Personal ID with the years they have participated. In every row, each Personal ID has different information such as Birth Year, City, State, etc. that I want to preserve once I have my final output. Every row that has the same Personal ID has the exact same information, except, of course, the Year Start that we used to have our final output. Is there a way to preserve that data for the output?

 

For example,

 

Personal IDYear StartCityState
00012016AustinTexas
00012017Austin

Texas

00022018New YorkNew York
00022019New YorkNew York

 

Output:

Personal ID2016201720182019CityState
0001YesYesNoNoAustinTexas
0002NoNoYesYesNew YorkNew York

 

Please let me know if you need any additional information.

 

Thank you very much once again!

Hi @pablomtz28 

 

Yes. You will just need to add City and State to your "Group By" fields in the "CrossTab".

 

Please see attached. Cheers!

christine_assaad_0-1595266653880.png

 

Labels
Top Solution Authors