Attempting to aggregate / count values from a temporary table | Community
Skip to main content
cbeattie1992
July 27, 2018
Solved

Attempting to aggregate / count values from a temporary table

  • July 27, 2018
  • 4 replies
  • 7440 views

Hello,

I am trying to count of Number of Customer Contact Rule ID's per Contact Rule grouped by Name and Value from with a temporary table which i have created
with the workflow.

The number of Customer Contact Rule ID's per Contact Rule within the temp table have already under gone some deduplication criteria before getting to the aggregate stage in the workflow. Therefore i wish to count the total of Customer Contact ID's within the temp table.

Grouped by 2 values:

  • Contact Rule Name (Customer ContactTable)
  • Customer Contact Value (Contact Rule Table) - Different tables

I can count the number of Customer Contact Rule ID's when looking at the linking using the add data function: Data Linked to filter dimension. However this of course returns the total number of product id's with no reference to the population within the temp table.

When i select the criteria within the enrichment: Data of the filtering dimension.  I proceed to count on the Id's from the temp table and then group on the 2 values.

Then i checked the advanced parameters box 'Group by targeting dimension'

However i continue to the follow error message:

'must appear in the group by clause or be used in an aggregate function'

I believe this might be due to the fact that i am grouping on values within the temp table - but are group different tables?

Please any help around this would be fantastic,

thanks a lot

Connor

Best answer by DebTr

Hi cbeattie1992,

If you can put the exact error screenshot from the workflow audit it would be helpful.

However if you are getting the error stating, "id(key column) should be part of the aggregate function or group by", then you may need to change the following in your query activity.

Query Activity->Edit Additional Data->Advanced Parameters->Check "Disable automatic addition of primary keys of the targeting dimension"

Cheers,

Deb

4 replies

pablo_rosero1
Level 9
November 27, 2018

Hi Connor,

I'm unsure of this one. Perhaps you could have a new ID to Count on your temporary Table as a workaround?

All the best,

Pablo

DebTrAccepted solution
Level 6
November 27, 2018

Hi cbeattie1992,

If you can put the exact error screenshot from the workflow audit it would be helpful.

However if you are getting the error stating, "id(key column) should be part of the aggregate function or group by", then you may need to change the following in your query activity.

Query Activity->Edit Additional Data->Advanced Parameters->Check "Disable automatic addition of primary keys of the targeting dimension"

Cheers,

Deb

szymons55769873
Level 2
June 28, 2019

Hello

I've got a similar issue and I've done the suggested fix however now the Enrichment throws the following error:

Any hints?

I'm trying to group a temp schema based on Recipient's primary key and aggregating the number of "Opens" and "Clicks" from the Recipient tracking log.

Temporary schema contains all records from the Recipient tracking log matched with a different schema.

Level 6
July 10, 2019

Hi,

Can You try uncheck "Keep All Additionla Data from main Target" in enrichment.

Regards,

Deb