Alteryx Designer Desktop Discussions

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

Grouping All records as a group

Crimsntyd
5 - Atom

Hi,

 

I have a workflow where I'm able to split the incoming data into two groups (let's say A and B) based on the value in one field (I actually do this in the SQL queries at the beginning...then I join the results of the two queries after doing so; "A" is only in one query, whereas "B" is in both datasources).  I want to have a third group called "All" in addition to A and B in my output.  Not sure if there's a way to do this in SQL or in Alteryx, but there's got to be a way, right?  Thanks in advance.

5 REPLIES 5
jdunkerley79
ACE Emeritus
ACE Emeritus

I'm not in front of Alteryx at the moment so can't make a sample but think the following should work

 

Take the output of the SQL and use a formula tool to replace the group value (A/B) with 'All'.

Use a union tool to take the original output of SQL and the output of the formula tool.

The resulting output should then have all three groups (A/B/All)

Crimsntyd
5 - Atom

thumbs_up.jpg

Brilliant!  Thanks, man!

Crimsntyd
5 - Atom

Well, thanks for the previous answer, but NOW, "All" is getting truncated in the output.  I've used Join and Union to try to eliminate it, but it's still showing up as "Al" instead of "All" (the data I'm replacing are actually two characters in length).  Help again?

jdunkerley79
ACE Emeritus
ACE Emeritus

Put a select tool after the sql input. Use this to increase the length of the grouping name to 3 characters. Then it will be fine.

2016-05-03_20-49-42.jpg

Crimsntyd
5 - Atom

Works like a charm.  Thanks again!

Labels