Is it possible to write a group by conditions in PQL for audience rule? | Community
Skip to main content
Level 3
January 26, 2024
Solved

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

  • January 26, 2024
  • 1 reply
  • 597 views

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
1101/01/1980
2102/02/1981
3203/04/1982

 

Condition

  • 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
1101/01/1980
3203/04/1982
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by AnanthanJa

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.

 

https://experienceleague.adobe.com/docs/journey-optimizer/using/audiences-profiles-identities/audiences/audience-orchestration/create-compositions.html?lang=en

 

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

 

1 reply

AnanthanJaAdobe EmployeeAccepted solution
Adobe Employee
January 30, 2024

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.

 

https://experienceleague.adobe.com/docs/journey-optimizer/using/audiences-profiles-identities/audiences/audience-orchestration/create-compositions.html?lang=en

 

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