Calcite | Level 5

Pviot Reports on Aggregated Data- Proc report, proc means or proc summary ?

Hi,

I got following data:

Name Amount

1         100

1         200

2         300

2         ...

3         ..

3         ..

3         ..

What procedure is best to use to create following report/output:

1st Col     2ndCol                                          3rd                                                               4th

Name1     Aggregated Sum of Amount of Name1         Cum. Percentage of Agg.Sum Name1        Counts of Name1

Name2     Aggregated Sum of Amount of Name2         Cum. Percentage of Agg.Sum Name1        Counts of Name1

Name3    Aggregated Sum of Amount of Name3          Cum. Percentage of Agg.Sum Name1        Counts of Name1

...

-------------------------------------------------------------------------------------------------------------------------------------

Total....  Total of Aggregated Sum             100%                                                               Total Counts

Number of Missing:

I tried it with proc report so far, but I did not get the desired results´. I'm using SAS Enterprise Guide, so I'm also open to drag & drop solutions.

Thanks,

fuhgid

2 REPLIES 2
SAS Super FREQ

Re: Pviot Reports on Aggregated Data- Proc report, proc means or proc summary ?

Without a better understanding of how you plan to calculate the "cum percentage", this is a nearly impossible task.
For example, your name1 has a 2 rows with total amount of 300. So I assume that your column 2 value would be 300 and your column 4 value would be 2. But, how to calculate the cum percentage based on 300 -- what is the denominator to calculate the percentage? The total of all the amount values?

I don't understand what you mean by number of missing? Number of rows with missing names, with missing amounts? Why/how would you have a name without an amount or an amount without a name?

Can you post some data, just a small sample and then show, EXACTLY, what results you expect given your data. Because without any information on how to base "cum percentage", it is impossible to make a constructive suggestion -- there's not enough information.

Cynthia
Diamond | Level 26

Re: Pviot Reports on Aggregated Data- Proc report, proc means or proc summary ?

Pviot Reports on Aggregated Data- Proc report, proc means or proc summary ?

Why does it have to be one of these three? Why not one of the above (specifically PROC MEANS or PROC SUMMARY), followed by a DATA step?

--
Paige Miller
Discussion stats
• 2 replies
• 373 views
• 0 likes
• 3 in conversation