Count with group by | Community
Skip to main content
Level 2
Jun 11, 2020 12:47 AM UTC
Solved

Count with group by

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
bisswangAccepted solution
Employee
Jun 11, 2020 5:49 AM UTC

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

1 reply

bisswangAccepted solution
Employee
Jun 11, 2020 5:49 AM UTC

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

Translate