Add a data grouping clause | Community
Skip to main content
Level 2
February 20, 2024
Solved

Add a data grouping clause

  • February 20, 2024
  • 2 replies
  • 1047 views

Hi team,

 

Does anyone explain the use of  "Add a data grouping clause" in query activity? share any use case for this concept.

@_manoj_kumar_ @parthasarathy @craig_thonis @davidkangni @marcel_szimonisz @david--garcia @costa_n11 @isahore @ananthanja @akshayanand 

 

Best answer by Craig_Thonis

Hi Kumar,

The Add a grouping clause means that you are adding a Group By to the generated SQL statement. To understand how a Group By works, check out the documentation below:

https://www.postgresqltutorial.com/postgresql-tutorial/postgresql-group-by/

 

To put it simply, as the name suggests, the function allows results to be grouped by certain criteria such as grouping recipients by country.

2 replies

Craig_Thonis
Adobe Employee
Craig_ThonisAdobe EmployeeAccepted solution
Adobe Employee
February 20, 2024

Hi Kumar,

The Add a grouping clause means that you are adding a Group By to the generated SQL statement. To understand how a Group By works, check out the documentation below:

https://www.postgresqltutorial.com/postgresql-tutorial/postgresql-group-by/

 

To put it simply, as the name suggests, the function allows results to be grouped by certain criteria such as grouping recipients by country.

Kumar_27Author
Level 2
February 20, 2024

Hi @craig_thonis ,

 

Thanks for your response. For my better understanding please provide any use case / Hands-on it's very helpful to understanding.  

Level 2
April 26, 2025

I will share one usecase. Recipients who more than 5 sales
Ex: Two tables are there. 
Recipient and product sales.
Add grouping condition like
Count(OrderId) greater than 5.

OrderId is from product sales table. So it will count number of purchases by customer and it is greater than 5. They only will be the target audience