Fastest way to merge multiple columns with exclusive NULL/non-NULL combos
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi, I have some columns that looks as follows, due to changes in an underlying data model:
Col 1 | Col 2
XX |
| YY
ZZ |
I want to make it like this:
Col 3
XX
YY
ZZ
Basically, if one col has a value, the other is always Null. The things is, I possibly have 25 pairs of columns like this and would really like to avoid manually making a IF (NULL) Then ... formula for every single one. Any tips on a fastest way to do this? Ideally all I would manually do is specify the row combinations...
One thing that has occurred to me is transposing the columns to rows, then change the names of pairs to be the same, then cross-tabing back.. Alternatively, concatenating the columns but I need to be careful about NULL vs. empty strings and types 😕
I guess I might end up doing that, but curious if I am missing anything else + trying to learn best practices!
Thank you!
Rajko
Solved! Go to Solution.
- Labels:
- Data Investigation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
sorry, realized I didnt clarify that, adding now!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Rajko ,
Assuming that your input looks something similar to the following:
then I believe the attached workflow will return you the output you are looking for
Hope that helps, let me know if that worked for you.
Regards,
Angelos
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Yeah thats awesome thanks so much!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Rajko ,
Something like this should work and would work for any number of columns. Let me know what you think!
Edit: Whoops! Looks like @AngelosPachis beat me to it. Glad you got what you needed!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Im looking at your multirow formula and don't understand why the columnIDs start repeating after it its 6? What causes the loop to reset?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Still interesting for me to see approaches, thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Great questions @Rajko ,
If you look at the configuration window of the multi-row formula tool, I have grouped on the field Record ID.
That causes the calculation to reset, for each distinct Record ID value in my dataset, and that's what causes the Column ID to start repeating after 6.
