Expand my Community achievements bar.

Dive in, experiment, and see how our AI Assistant Content Accelerator can transform your workflows with personalized, efficient content solutions through our newly designed playground experience.
SOLVED

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

Avatar

Level 3

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
1 Accepted Solution

Avatar

Correct answer by
Employee

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/audien...

 

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

 

View solution in original post

1 Reply

Avatar

Correct answer by
Employee

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/audien...

 

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