Expand my Community achievements bar.

Join us for the Adobe Journey Optimizer Community Q&A Coffee Break on 28th February at 8 am PT with Ariel Sultan, Daniel Wright, Josee Haeley and Rohit Basuri.

Is it possible to write a group by conditions in PQL for audience rule?


Level 2

Is it possible to write group by OR nested group by in PQL queries for an audience evaluation? If yes, What is the syntax?


Profile IDRankingDateofBirth



  • If Ranking score is same, Pick one profile by Max Date of birth
  • If Date of birth is same, then pick one random profile


End result


Profile IDRankingDateofBirth
1 Reply



Hi @ShashiCh,


PQL by definition works on individual profile-level data and not at a dataset level.

However, what you are referring to is sorting the data at a dataset level and then applying data split. Hence pql will not be able to support it.


You can consider using a data distiller to create a new dataset and mark attributes based on the split that you require. In simple words, you can use SQL expressions for the same. 


You can also consider using Rank and Split activity inside Audience Composition workflows. Refer to the documentation.




Do check on the guardrails on the number of audience composition workflows that you can create in a sandbox.