Count with group by

Avatar

Avatar
Validate 1
Level 1
gabrielf1
Level 1

Likes

0 likes

Total Posts

14 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Give Back
Applaud 5
View profile

Avatar
Validate 1
Level 1
gabrielf1
Level 1

Likes

0 likes

Total Posts

14 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Give Back
Applaud 5
View profile
gabrielf1
Level 1

10-06-2020

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 250
Employee
ramon_bisswanger
Employee

Likes

271 likes

Total Posts

397 posts

Correct reply

199 solutions
Top badges earned
Boost 250
Affirm 100
Give Back 25
View profile

Avatar
Boost 250
Employee
ramon_bisswanger
Employee

Likes

271 likes

Total Posts

397 posts

Correct reply

199 solutions
Top badges earned
Boost 250
Affirm 100
Give Back 25
View profile
ramon_bisswanger
Employee

10-06-2020

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

Answers (0)