<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: proc report with across in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-report-with-across/m-p/699755#M214062</link>
    <description>&lt;P&gt;To get a column of a particular color (let's say blue), you could also use a variable, and tell PROC REPORT to display the variable text in blue and background color in blue, and so you can't see the text, it appears to be an entirely blue column.&lt;/P&gt;</description>
    <pubDate>Wed, 18 Nov 2020 12:19:27 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2020-11-18T12:19:27Z</dc:date>
    <item>
      <title>proc report with across</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-with-across/m-p/699463#M213969</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I am trying to create a summary report that will contain following columns:&lt;/P&gt;
&lt;P&gt;Team categories&lt;/P&gt;
&lt;P&gt;Sum of Y for source 2009&lt;/P&gt;
&lt;P&gt;Sum of Y for source 1909&lt;/P&gt;
&lt;P&gt;Number of customers in 2009&lt;/P&gt;
&lt;P&gt;Number of customer in 1909&lt;/P&gt;
&lt;P&gt;pct number of customers 2009 (from total)&lt;/P&gt;
&lt;P&gt;pct number of customers 1909 (from total)&lt;/P&gt;
&lt;P&gt;pct&amp;nbsp; sum of y 2009 (from total)&lt;BR /&gt;pct&amp;nbsp; sum of y 1909 (from total)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The error I receive is&lt;/P&gt;
&lt;P&gt;ERROR: There is more than one ANALYSIS usage associated with&lt;BR /&gt;the column defined by the following elements.&lt;BR /&gt;Name Usage&lt;BR /&gt;-------------------------------- --------&lt;BR /&gt;source ANALYSIS&lt;BR /&gt;Y ANALYSIS&lt;BR /&gt;n STATISTIC&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
Data ttt;
input ID team $ source Y;
cards;
1 a 2009 10
2 a 2009 15
3 b 2009 20
4 a 2009 25
5 a 2009 30
6 b 2009 18
1 b 1909 22
3 b 1909 32
4 a 1909 50
6 a 1909 5
;
run;


proc report data=ttt nowd out=wanted style(summary)=Header;
column team ( source,(Y, (n sum  pctn pctsum)));
define team / group style(column)=Header;
define Y/sum;
define n/ 'Nr_Customers' f=comma28.;
define Y/" " analysis sum;
define sum / "Revenue" f=comma28.;
define pctn / 'PCT_Customers' f=percent9.2;
define pctsum/ 'PCT_Y' f=percent9.2;
rbreak after /summarize  style (summary)=Header;
compute after;
endcomp;
Run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 12:25:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-with-across/m-p/699463#M213969</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-11-17T12:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: proc report with across</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-with-across/m-p/699468#M213972</link>
      <description>&lt;P&gt;SOURCE is an across variable, but it doesn't appear in a DEFINE statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=ttt nowd out=wanted style(summary)=Header;
column team  source,Y, (n sum  pctn pctsum);
define team / group style(column)=Header;
define source/across;
define n/ 'Nr_Customers' f=comma28.;
define Y/" " analysis sum;
define sum / "Revenue" f=comma28.;
define pctn / 'PCT_Customers' f=percent9.2;
define pctsum/ 'PCT_Y' f=percent9.2;
rbreak after /summarize  style (summary)=Header;
compute after;
endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;If I may be so bold as to make a suggestion on improvement, the value in the label in the DEFINE statement doesn't have to follow SAS variable naming rules. You could use actual readable English words/phrases, such as&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;define n/ 'Number of Customers' f=comma28.;
define pctsum/'Percent of Revenue'&amp;nbsp;f=percent9.2;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 12:53:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-with-across/m-p/699468#M213972</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-11-17T12:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: proc report with across</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-with-across/m-p/699481#M213977</link>
      <description>Great!!!&lt;BR /&gt;One more question.&lt;BR /&gt;If I want to have another order of columns that for each statistics will see a pair of columns ,what will be the way to do it?&lt;BR /&gt;So the order of columns will be &lt;BR /&gt;Team&lt;BR /&gt;&lt;BR /&gt;Sum of Y for source 2009&lt;BR /&gt;Sum of Y for source 1909&lt;BR /&gt;&lt;BR /&gt;Number of customers in 2009&lt;BR /&gt;Number of customer in 1909&lt;BR /&gt;&lt;BR /&gt;pct number of customers 2009 (from total)&lt;BR /&gt;pct number of customers 1909 (from total)&lt;BR /&gt;&lt;BR /&gt;pct  sum of y 2009 (from total)&lt;BR /&gt;pct  sum of y 1909 (from total)</description>
      <pubDate>Tue, 17 Nov 2020 13:29:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-with-across/m-p/699481#M213977</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-11-17T13:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: proc report with across</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-with-across/m-p/699488#M213981</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;column team  source,Y,sum source,Y,n source,y,pctn source,y,pctsum;
define source/across descending;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Nov 2020 13:44:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-with-across/m-p/699488#M213981</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-11-17T13:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: proc report with across</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-with-across/m-p/699493#M213982</link>
      <description>Is it possible to add a narrow empty column with dark blue color between each pair of column? and also to do grey background for total roaw.&lt;BR /&gt; columns will be :&lt;BR /&gt;Team&lt;BR /&gt;Sum of Y for source 2009&lt;BR /&gt;Sum of Y for source 1909&lt;BR /&gt;empty column with dark blue background&lt;BR /&gt;Number of customers in 2009&lt;BR /&gt;Number of customer in 1909&lt;BR /&gt;empty column with dark blue background&lt;BR /&gt;pct number of customers 2009 (from total)&lt;BR /&gt;pct number of customers 1909 (from total)&lt;BR /&gt;empty column with dark blue background&lt;BR /&gt;pct sum of y 2009 (from total)&lt;BR /&gt;pct sum of y 1909 (from total)&lt;BR /&gt;empty column with dark blue background&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Nov 2020 13:56:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-with-across/m-p/699493#M213982</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-11-17T13:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: proc report with across</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-with-across/m-p/699540#M213999</link>
      <description>&lt;P&gt;An actual "column", in Proc report terms would mean a variable is needed.&lt;/P&gt;
&lt;P&gt;A BORDER can be applied to any side of a cell with a style option such as in below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc report data=ttt nowd out=wanted style(summary)=Header;
column team  source,Y, (n sum  pctn pctsum);
define team / group style(column)=Header;
define source/across;
define n/ 'Nr_Customers' f=comma28.;
define Y/" " analysis sum;
define sum / "Revenue" f=comma28.
            style={borderleftwidth=4 borderleftcolor=blue};
define pctn / 'PCT_Customers' f=percent9.2;
define pctsum/ 'PCT_Y' f=percent9.2;
rbreak after /summarize  style (summary)=Header;
compute after;
endcomp;
run;
&lt;/PRE&gt;
&lt;P&gt;Depending on your ods destination you may want to specify a unit with the border width for more positive control.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are currently telling the summary row to use the header style. This sets the background to light gray:&lt;/P&gt;
&lt;PRE&gt;rbreak after /summarize  style (summary)={background=lightgray};
&lt;/PRE&gt;
&lt;P&gt;Any other appearance options are done with style element name = property.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 15:40:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-with-across/m-p/699540#M213999</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-11-17T15:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: proc report with across</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-with-across/m-p/699755#M214062</link>
      <description>&lt;P&gt;To get a column of a particular color (let's say blue), you could also use a variable, and tell PROC REPORT to display the variable text in blue and background color in blue, and so you can't see the text, it appears to be an entirely blue column.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 12:19:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-with-across/m-p/699755#M214062</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-11-18T12:19:27Z</dc:date>
    </item>
  </channel>
</rss>

