DATA Step, Macro, Functions and more

cluster count

Reply
Super Contributor
Posts: 647

cluster count

There is this table uniqcust which will have unique id's

and other table cluster which will have id and cluster.

we select only those records that are common in uniqcluster and cluster tables

uniqcust table:

1

2

3

4

5

6

7

8

9

10

cluster table:

1 12345

2 12345

3 12345

4 12345

5 12345

6 12345

7 12345

8 23456

9 23456

10 23456

now when the condition is if cluster count is >5 ,output must be:

1 5 6 2

The first column 1 is the minium id of cluster 12345 and their cluster count is 5 and after that threshold the next minimum id is 6 and it has cluster count of 2 (which are 6 and 7).

only one record is displayed since their counts belong to 12345 cluster.

Scenario 2

cluster table:

1 12345

1 23456

2 12345

3 12345

4 12345

5 12345

6 12345

5 23456

6 23456

7 23456

8 23456

9 23456

10 23456

output:

1 5 6 1

1 5 9 2

The first column 1 is the minium id of cluster 12345 and their cluster count is 5 and after that threshold the next minimum id is 6 and it has cluster count of 1.

second row,The first column 1 is the minium id of cluster 23456 and their cluster count is 5 and after that threshold the next minimum id is 9 and it has cluster count of 2 (which are 9 and10).

Ask a Question
Discussion stats
  • 0 replies
  • 153 views
  • 0 likes
  • 1 in conversation