Skip to Content
0

UNIQUE values from a column in calculated view

Jul 24, 2017 at 06:07 PM

79

avatar image
Former Member

Hi SAP community... I am having a really difficult time finding an answer to this question, and I was hoping someone might be able to help out. I need to get UNIQUE (not distinct) values from a column within a calculated view. I've attempted a number of different filter expressions, but nothing has given me the correct output. Here is an example of the output I need:

INPUT TABLE

SystemID

1

1

2

3

3

4

5

OUTPUT TABLE

SystemId

2

4

5

Any help would be greatly appreciated.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

avatar image
Former Member Jul 24, 2017 at 09:22 PM
-1

Sort itab by SystemID.

delete adjacent duplicated from itab comparing SystemID.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

This would give me distinct, but not unique.

0
Fabian Lupa Jul 24, 2017 at 08:52 PM
0

I am not familiar with the tools in BW Modeling, but in SQL this seems like a simple GROUP BY. Maybe that helps?

SELECT systemid
  FROM table
  GROUP BY systemid
  HAVING COUNT(*) = 1;
Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Yea, unfortunately it is not the same in the modeling interface. I ended up creating a secondary CV_Script, and utilized the output of that in the original CV, instead of trying to handle it all from the original CV. Thanks

0