Hi all,
I am trying to achieve the below (dummy data) via the transpose tool. Essentially, we want one row per contact name/address. Individuals can provide up to three contacts (not all will have three - would prefer not to have null rows).
My issue with a regular transpose is that I only have one 'name' column and one 'value column' -- whereas I need two each to capture name and email address.
Appreciate any solutions.
Input:
Output:
I figured it out
What you want to do is to come up with one common way to look at all names and email addresses, as well as a way to have a unique ID for each contact.
My workflow:
I hope this works for you.
Edit: This is the result
Thanks a bunch! The file isn't opening for me but will try to recreate. Appreciate any additional details or screenshots on the regex tool as this is my first time using it! Thank you.
Bummer the file didn't work. Can you try the attached workflow package on this comment? Maybe the issue had to do with not having relative references.
Screenshots are below
Transpose configuration:
Regex configuration:
For the regular expression itself, the "\<\w+\>" just means a word, so it picks up Contact. Then the "\s" means space, so it picks up the space after Contact. Then the (\d) is looking for a digit character, and the parentheses puts it in a marked group, which is what we want to pull out from the string. Then after that there is another "\s" for the space after Contact 1, Contact 2, or Contact 3, then another "\<\w+\>" that describes Name or Email.
In hindsight, we could have made that last "\<\w+\>" a marked group too and parsed it out into a new column, instead of doing it with the formula tool next... But both ways work.
Formula tool configuration:
The regex I used here is a little different, but still accomplishes the same thing as if we used the same regex from the previous step. I use "$3" to represent the 3rd marked group, which in this case is either "Name" or "Email"
Crosstab configuration:
Just group by the fields that are not Name2 (either Name or Email) or Value (The name of the contact, or that contact's email address). Make the column headers Name2 so that the email addresses are now in the Email column while contact names are in Name2. Values for New columns come from Value.
Select tool configuration:
I dropped the contact number field, since you didnt want that in your output, and renamed Name2 to Contact Name and Email to Contact Email.
I hope this helps you to recreate it.
Thank you so much!! I think because it was saved as a package it won't open on my desktop (don't seem to be having a problem with yxmd).
Question: How did 'Name2' come about? It seems to pop up after the transpose.
Edit: Nevermind! Assuming the transpose generated the Name2 field (opposed to Name) since I had already provided a field titled 'name' in the dummy data - forgot since it's 'candidate full name' in my real data. So I'm assuming where you reference Name2, I will reference Name.
Thanks!