turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- Base SAS Programming
- /
- proc report - grouping - how to get only selecte g...

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

12-28-2017 09:30 AM - edited 12-28-2017 10:52 AM

I am creating a report where i am grouping by probability but i dont want the row with probability=0 to be included. How to do that?

```
proc report data= c1.o;
columns probability____ probability____=opp Total_Media_Value Forecasted_Budget ;
define probability____ / group descending 'Probability';
define Total_Media_Value / SUM 'Total Budget' format= dollar30. ;
define Forecasted_Budget/ computed 'Forecasted Budget'format= dollar30.;
compute Forecasted_Budget;
Forecasted_Budget= (Total_Media_Value.sum)*(probability____);
endcomp;
define opp/n 'Num_of_optys';
rbreak after/ ol summarize style=[backgroundcolor= grrp color=aliceblue ];
title 'London Olympic Pipeline As of 17th November 2012';
run;
```

right now i have groups for probability 1, 0.9,0.8,0.7 till 0. But I want groups from 1 till 0.1 , and exclude the group with probability 0

Accepted Solutions

Solution

12-28-2017
11:54 AM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to riya275

12-28-2017 11:29 AM

you could just use a where statement in the proc report line ie:

`proc report data= c1.o (where=(probablity ne 0));`

All Replies

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to riya275

12-28-2017 10:34 AM

can you show an image of what the table should look like? i think you want something like:

define probability_____ / order order=data noprint;

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to PaulBrownPhD

12-28-2017 10:53 AM

sorry , i have edited the uestion

Solution

12-28-2017
11:54 AM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to riya275

12-28-2017 11:29 AM

you could just use a where statement in the proc report line ie:

`proc report data= c1.o (where=(probablity ne 0));`