Alteryx Designer Desktop Discussions

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

Splitting & Aggregating Data

kpontarollo
8 - Asteroid

Hello! I need help with the following. In my input data, I have column labeled "Segment" and then A... B.... C... etc. I have to manipulate the data within each segment, so segment A, Segment B, Segment C.

 

In my attached file you see that, the data comes in, I filter on which segment I would like, it goes through its own little manipulation, and then comes together in a union. My issue is that when there are a million "segments" this takes me forever to build. Is there an easier way to have it automatically split into the segment, run through its query, and then come back together?

 

10 REPLIES 10
jdminton
12 - Quasar

It's hard to tell without knowing what happens inside the containers. Depending on what's happening, you may be able to use a formula tool and an if statement to perform the functions in the containers so it wouldn't need to be split. There may be other options as well. What is happening in the containers?

cjaneczko
13 - Pulsar

What is happening at each of the "Segments" its hard to tell what you are looking to do. Some more information would help steer you in the right direction. What is the manipulation that takes place at each segment?

kpontarollo
8 - Asteroid

Within the filters, a conversion is happening. Each of the boxes have the same conversion going on. It is basically a formula that says when there is two consecutive 1's in a row, switch it to 0. What is going on inside the boxes is confusing but its the same for each box. I just need to separate it out by Segment A.... have it go through the conversion and same for Segment B and Segment C and then bring it all together in the end.

oyes2704
8 - Asteroid

Hi @kpontarollo 

Most common calculations could be done using Summaries and Joins within the "All segment" dataset but definitely you might have something specific where it's not enough.

 

You can use Batch Macros that you can parameterize to work for each independent Segment as Control GroupBy Field and it will concatenate the results automatically: Apps and Macros Guide - Alteryx Community

 

The recorded training is amazing and should be exactly what you need: Build Your First Batch Macro! - Alteryx Community

cjaneczko
13 - Pulsar

You aren't able to accomplish this with a formula tool on all of them at once? Can you provide a sample dataset of two of the segments to see what the difference between them are?

kpontarollo
8 - Asteroid

so everytime a new segment gets added to the list, I have to add another filter, let it go through the boxed manipulation, and then add it back in.

 

Instead of having to add a new filter every time, I would like the data to split on its own, i that makes sense.

kpontarollo
8 - Asteroid

No I cannot, its specific to my line of work, so it would take me an hour to explain why it has to be broken out this way. But in a nutshell, I need to be able to divide it by multiple segments, they all have to go through their individual manipulations and then union at the end to bring it together. 

 

What I am trying to solve is solely if there is a way to make it so I dont have to add a filter every time a new segment comes in

jdminton
12 - Quasar

It really does depend on what you are doing in the containers. You would likely need a batch macro to run the process and union everything back together. Whatever field you are filtering on would be used in the batch process. If you have multiple criteria in the filter, you may need to use a formula to to create a categorization field.

 

You may also be able to use a formula tool if it is simple enough such as:

IF [Segment] = "Segment A"

THEN Replace([Number], "11","0")

ELSE [Number]

ENDIF

but then you are still having to add a formula for each new segment.

 

I am having trouble understanding why they need to be separate if they are all going through the same process in the containers though. Maybe that's not what you meant to say? If it is different, is there a formulaic way to write it?

 

kpontarollo
8 - Asteroid

Its truly hard to wrap my own head around it and its my field of work, so I have dumb downed basically what is going on in that closed box. It is a complex formula and hard to explain why it needs to happen that way. But, it does. I need to figure out a way for everytime new data comes in, and a new segment is added, a way to just divide it out faster. 

Labels