Join the Alteryx Community’s Maveryx Summer Cup event! Compete, network with others, and earn your gold through a series of challenges from July 24th to August 11th. Learn more about the event here.

Alteryx Designer Desktop Discussions

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

Creating Subsets

Riot
8 - Asteroid

So I am tasked with creating subsets for my data. We have a couple hundred columns. So it is basically Create subset "Hypertension" is variable Clinic01 == 1 but there are many different subsets I have to create. In my head, I imagine that I can get there by creating a bunch of Filter Tools, but I have about a hundred subsets to create, so i was wondering if there exist a faster and more efficent way to create subsets. I have lookedbut have been unable to find them. Thank you. 

9 REPLIES 9
MarqueeCrew
20 - Arcturus
20 - Arcturus
Robert,

If you are outputting the subsets, you can take name from a field and append it to the filename. You can keep the field in the data and create hundreds of output files from just a single output tool.

Thanks,

Mark
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Riot
8 - Asteroid

I am not quite following you good sir. 

 

For one section, my "WholeClean" file I have  :

 

Hypertension <- subset(WholeClean, clinic01 == 1)
 Hypertension_Limited <- subset(WholeClean, clinic02 == 1)
Angina <- subset(WholeClean, clinic03 == 1)
 CoronaryArteryDis <- subset(WholeClean, clinic05 == 1)
 MyocardialInf <- subset(WholeClean, clinic09 == 1)
 Arthritis <- subset(WholeClean, clinic19 == 1)
Arthritis_Limited <- subset(WholeClean, clinic20 == 1)
 Migraines <- subset(WholeClean, clinic21 == 1)
Migraines_Limited <- subset(WholeClean, clinic22 == 1)
 Asthma <- subset(WholeClean, clinic23 == 1)
Asthma_Limited <- subset(WholeClean, clinic24 == 1)
DiabetesSym <- subset(WholeClean, clinic31 == 1)
 Depression <- subset(WholeClean, clinic44 == 1)
 Depression_Limited <- subset(WholeClean, clinic45 == 1)
 Anxiety <- subset(WholeClean, clinic49 == 1)
 Anxiety_Limited <- subset(WholeClean, clinic50 == 1)
 
So the first part is the name of the subset I am creating, WholeClean is the name of my file, clinic## is the column I am testing. 
 
MarqueeCrew
20 - Arcturus
20 - Arcturus
If @jjdunkerly doesn't get you an answer by tonight, I will work with you tomorrow am. Sorry, I'm at an Alteryx roadshow without my laptop.
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
MarqueeCrew
20 - Arcturus
20 - Arcturus
Correction @jdunkerley79
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Riot
8 - Asteroid

Thank you, I appreciate it. 

jdunkerley79
ACE Emeritus
ACE Emeritus

Happy to have a go @MarqueeCrew,

 

Could you send a sampe set of data to work with (by all means DM if you need to)?

jdunkerley79
ACE Emeritus
ACE Emeritus

Ok so here is a first go.

 

I take the data and transpose it so looks like:

2016-04-21_22-23-16.jpg

 

Filter this where the value is 1. I am working with a numeric field but this can be changed to cope as needed.

After that I join to a table mapping clinic to subset name

This gives a set of subsets each case belongs to

 

Next join back to the original data to add a subset field and duplicate the rows for those cases in multiple subsets

 

Finally as @MarqueeCrew mentioned use an Output tool to save to a set of files append the subset name to the file name to create a set of files one for each subset

 

2016-04-21_22-26-43.jpg

Sample attached with some fake data. Will Write to C:\Temp when run

Riot
8 - Asteroid

That looks good. I am going to try all f my data like that and see how it works out. Thank you so much. Im still a little unclear with the output thing, but I will try and figure it out. 

jdunkerley79
ACE Emeritus
ACE Emeritus

The output tool has a config section that controls saving to different files:

2016-04-21_22-50-32.jpg

 

Very useful feature.

Labels