Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

How would perform the Alteryx equivalent of a GROUP BY and HAVING Clause...

FogoFortitude
7 - Meteor

- How would perform the Alteryx equivalent of a GROUP BY and HAVING Clause

- How many ways are possible to go about it?

- What is the best practice in applying the Alteryx Equivalent? 

SELECT A, Count(*)
FROM TABLE
GROUP BY A
HAVING COUNT(*) > 1

 

3 REPLIES 3
MarqueeCrew
20 - Arcturus
20 - Arcturus

@FogoFortitude,

 

Here's how:

 

  • SUMMARIZE
    • Groupby A
    • Count A
  • FILTER the output of the summarize with
    • Count > 1
  • Join the original data (going into the summarize) with the output of the Filter on A = A
    • Unselect the RIght_A field and the Count field

 

Cheers,
Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
lrygiel
7 - Meteor

Mark,

Thanks for the solution but I'm not sure why you are joining the output of the summarize/filter flow to the original data?

Doesn't the original SQL return counts by group A?

If Table contains:

A
---
XX
XX
YY
YY
YY
YY
ZZ

SELECT A, Count(*)
FROM TABLE
GROUP BY A
HAVING COUNT(*) > 1

Returns:

A  | COUNT(*)
-------------
XX | 2
YY | 4

Isn't that what the result of the summarize & filter control would produce?

Maybe I'm looking at it wrong (it won't be the first time).

Thanks,

Lee

MarqueeCrew
20 - Arcturus
20 - Arcturus

@lrygiel,

 

Yes.  You've got a point. Summarize & Filter is all that's needed.

 

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Labels
Top Solution Authors