Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

The 4th edition of the Campaign Community Lens newsletter is out now!
SOLVED

Count with group by

Avatar

Level 2

Hello,

 

Please, could you help me? How can I count the number of rows with a group by? I tried RowNum(PartitionBy(@IdCliente), OrderBy(@IdCliente)) but it doesn't works.

 

Att.,

Gabriel

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi Gabriel,

 

yes the RowNum would be the correct approach.

The item you want to group by is the column mentioned in PartitionBy.

i.e. for you it would count the row number per IdClient.

 

Note: the result will contain all rows still.

To keep only the highest number, you need to add a deduplication task, choose Expression as method, choose the calculated field containig the row number and choose to keep the highest value

View solution in original post

1 Reply

Avatar

Correct answer by
Employee Advisor

Hi Gabriel,

 

yes the RowNum would be the correct approach.

The item you want to group by is the column mentioned in PartitionBy.

i.e. for you it would count the row number per IdClient.

 

Note: the result will contain all rows still.

To keep only the highest number, you need to add a deduplication task, choose Expression as method, choose the calculated field containig the row number and choose to keep the highest value