background shape
background shape

Column must appear in GROUP BY clause

Creating aggregated data reports may not be a daily task, but there are times when you might be tasked with generating such reports. For instance, you could group and track log clicks to create the coveted ‘Hot Clicks Report’.

You tell yourself, ‘It’s nothing major,’ and believe you have an idea of how to do it. However, when you set everything up in the enrichment or query activity, you encounter the following error:

25/07/2023 19:31:15 query2 PGS-220000 PostgreSQL error: ERROR: 
column "t0.itrackinglogid" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: 
…nternalName, D2.sLabel, Count(T1.iTrackingUrlId), T0.iTracki…

Long story short Adobe Campaign Classic somehow always adds to the select clause primary key of the targeting dimension, thus never added to group clause and this message will start to haunt us. To remove this error you will need to check following option in Advanced parameters of Add data…

In short, Adobe Campaign Classic somehow always adds the primary key of the targeting dimension to the select clause. To resolve this error, you will need to check the following option in the Advanced Parameters of ‘Add Data…’

Good to remember:

Eventhough Add data... feature exists in Query, Enrichment, Change dimension but the ‘Disable automatic adding of the primary keys of targeting dimension’ only is found in the Query activity

You can only access the Advanced parameters from Edit additional data... So you will spend ages looking for it when adding data

Oh hi there 👋
I have a FREE e-book for you.

Sign up now to get an in-depth analysis of Adobe and Salesforce Marketing Clouds!

We don’t spam! Read our privacy policy for more info.

Share With Others

Leave a Comment

Your email address will not be published. Required fields are marked *

MarTech consultant

Marcel Szimonisz

Marcel Szimonisz

I specialize in solving problems, automating processes, and driving innovation through major marketing automation platforms.

Buy me a coffee