cancel
Showing results for 
Search instead for 
Did you mean: 

Count duplicate values with more than one row

Former Member
0 Kudos

Hello,

I am trying to calculate duplicate values in more than one row

Example

Group Option Division

12345 A 4

12345 A 4

12345 B 5

12345 C

Counts should be:

12345A4 2

12345B5 1

12345C 1

I tried using Count([Option];All) In([Group ]) however it will only allows me to count with two dimension. Please advise

denis_konovalov
Active Contributor
0 Kudos

I have fixed your tag to match content of your question, however, since you have provided no details at all about the product you're using this might need to be changed further later on.

Please select more careful and provide more details when asking.

Accepted Solutions (0)

Answers (2)

Answers (2)

amitrathi239
Active Contributor
0 Kudos

Assuming you are looking solution at Webi report level.if yes then use below formula.

=Count([Option];All) In([Group ];[Option])

former_member589989
Discoverer
0 Kudos

Try something like a COLLECT.
See that example, it may help you.

TYPES: BEGIN OF ty_count,
         bukrs   TYPE bseg-bukrs,
         count  TYPE i,
       END OF ty_count,

       BEGIN OF ty_bseg,
         key1   TYPE bseg-bukrs,
         key2   TYPE bseg-belnr,
       END OF ty_bseg.

DATA: it_count  TYPE TABLE OF ty_count,
      wa_count  TYPE ty_count,
      it_bseg  TYPE TABLE OF ty_bseg,
      wa_bseg  TYPE ty_bseg.

SELECT bukrs belnr
  FROM bseg
  INTO TABLE it_bseg.

LOOP AT it_bseg INTO wa_bseg.
  MOVE: wa_bseg-key1 TO wa_count-bukrs,
        1 TO wa_count-count.
  COLLECT wa_count INTO it_count.
ENDLOOP.