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

Function to Break Apart Fields

cblades3
6 - Meteoroid

Hello community,

So my issue is that I have a combined field coming from an excel file with hundreds of rows that looks something like this:

 

1. Lab Category A

a.  Lab abc

b. Lab xyz

2. Lab Category B

a. Lab lmn

b. Lab dfc

 

Basically I want to break apart this column and assign the lab category to the matching labs beneath it until I hit the next lab category like this:

 

 

 Lab abc          Lab Category A

 Lab xyz          Lab Category A

 Lab lmn         Lab Category B

 Lab dfc          Lab Category B

 

I have tried Regex Match to no avail thus far. Thank you for any assistance!

5 REPLIES 5
ivoller
12 - Quasar

Can you share sample data? I think you're on the right track but may need to use a Multi-field formula or similar to get the break down required.

cblades3
6 - Meteoroid

So my example is the sample data ,with names omitted, from a field in my spread sheet. The rest of the associated data to specific labs and their associated categories is quantitative. To elaborate though it would be something like this

 

Lab TypeNA - Lab CountData ConsumptionPriority Upgrade
1. Body and Chassis11.9
a. Full Vehicle Test Sys11.65
b. Component Sys11.20
c. Some Other Sys11.4
d. Another System11.1
2. Electrical11.15
a. Harness11.8

 

 

The real issue is splitting up the Lab column and assigning the associated labs under that lab category to it like this:

 

LabLab CategoryNA - Lab CountData ConsumptionPriority Upgrade
1. Body and ChassisBody and Chassis   
a. Full Vehicle Test SysBody and Chassis11.65
b. Component SysBody and Chassis11.20
c. Some Other SysBody and Chassis11.4
d. Another SystemBody and Chassis11.1
2. ElectricalElectrical   
2. Electrical LAbElectrical11.15
...etc.

 

Once my file is set up like this, I can pull off the prefixing and clean up the lab category heading rows that add no value to my data set. Thanks

 

 

 

mbarone
16 - Nebula
16 - Nebula

In your sample, what I'll call your "primary category" is prefixed with a number, a period, then a single space.  And your sub-categories are not.  If that's exactly the case, then it can be done fairly efficiently with a Mutli-Row Formula tool.  Basically, there has to be something in the incoming data that can be identified which will separate out the primary category from the subs.

 

If indeed, the format of the primary category will be #, ., then space, you can use this:
__01.jpg__02.jpg

cblades3
6 - Meteoroid

Thanks! I had a couple issues with it because the lab categories are more than one word in length but it worked out. I swapped \s with \d and then the new column had the lab categories with ' . ' in front but that was easy to trim off with a separate function 

mbarone
16 - Nebula
16 - Nebula
Glad to hear it. I figured it might need some tweaks but knew it would be enough to get you started.
Labels