Re: format row value based on value of another column proc report? #4

  • Follow


not an exact answer, but you might want to look at

    http://www.excursive.com/sas/weblog/2007/05/mixing-means-and-pctns-in-column-in.html

and

    http://www.excursive.com/sas/weblog/2007/04/dynamic-formats-in-proc-report.html



--
Jack Hamilton
jfh@alumni.stanford.org
Tots units fem for�a!




On Jul 29, 2009, at 12:35 pm, bigD wrote:

> Hi,
>
> Is it possible to format values in proc report based on the value in
> another column. For example, in a report for each company I have
> several measures, some are in percent and some are dollars. I would
> like to report any "cost" or "expense" with a dollar format and
> percents with percent format. As my code stands now, I can do only
> dollar format or a percent format.  I guess I need to pre process but
> I'm not sure where to begin.
>
> Thanks for any insights.
>
>
> data test; input measure : $40.  fY_2006;
> infile datalines dsd;
> datalines;
> % Contracted expenses,   1.4
> % of Amortization - Building,   2.4
> % of Other Expenses of Total Expenses,   5.4
> Cost per Day food,   292.6
> Cost per day travel,   52.4
> Equipment Expenditures %,   7
> Hotel %,   15.9
> Support %,   4
> ;run;
>
> proc report nowd  data=test;
> column measure fy_2006;
> define measure / display;
> define fY_2006 / analysis sum "Fiscal Year 2006 " format =dollar12.0;
> run;
0
Reply jfh (1363) 7/30/2009 1:46:08 AM

Thanks to everyone for their input. A lot of good information to work
with.




On Jul 29, 9:46=A0pm, j...@STANFORDALUMNI.ORG (Jack Hamilton) wrote:
> not an exact answer, but you might want to look at
>
> =A0 =A0http://www.excursive.com/sas/weblog/2007/05/mixing-means-and-pctns=
-in...
>
> and
>
> =A0 =A0http://www.excursive.com/sas/weblog/2007/04/dynamic-formats-in-pro=
c-r...
>
> --
> Jack Hamilton
> j...@alumni.stanford.org
> Tots units fem for=E7a!
>
> On Jul 29, 2009, at 12:35 pm, bigD wrote:
>
> > Hi,
>
> > Is it possible to format values in proc report based on the value in
> > another column. For example, in a report for each company I have
> > several measures, some are in percent and some are dollars. I would
> > like to report any "cost" or "expense" with a dollar format and
> > percents with percent format. As my code stands now, I can do only
> > dollar format or a percent format. =A0I guess I need to pre process but
> > I'm not sure where to begin.
>
> > Thanks for any insights.
>
> > data test; input measure : $40. =A0fY_2006;
> > infile datalines dsd;
> > datalines;
> > % Contracted expenses, =A0 1.4
> > % of Amortization - Building, =A0 2.4
> > % of Other Expenses of Total Expenses, =A0 5.4
> > Cost per Day food, =A0 292.6
> > Cost per day travel, =A0 52.4
> > Equipment Expenditures %, =A0 7
> > Hotel %, =A0 15.9
> > Support %, =A0 4
> > ;run;
>
> > proc report nowd =A0data=3Dtest;
> > column measure fy_2006;
> > define measure / display;
> > define fY_2006 / analysis sum "Fiscal Year 2006 " format =3Ddollar12.0;
> > run;

0
Reply diaphanosoma (44) 7/30/2009 3:07:46 PM


1 Replies
28 Views

(page loaded in 0.057 seconds)


Reply: