<?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: Report -stacking values and add label rows in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Report-stacking-values-and-add-label-rows/m-p/839611#M331963</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;   
Input   ID  month  $   Nr_Purchases Total_Amount_Dollars;   
cards;   
1111 2022-01 10 1000
1111 2022-02 18 1400
1111 2022-03 6 300
1111 2022-04 22 2000
1111 2022-05 19 1300
1111 2022-06 14 1500
2222 2022-01 13 800
2222 2022-02 17 1000
2222 2022-03 4 100
2222 2022-04 12 800
2222 2022-05 10 900
2222 2022-06 27 3000
;     
Run;

proc report data=have nowd spanrows;
columns ('ID' ID)  ('month' month)    
('Nr_Purchases' Nr_Purchases) ('Total_Amount_Dollars' Total_Amount_Dollars );
define id/order style={vjust=m just=c};
define month/display;

label    
ID='Customer ID'   
month='YYYY-MM'   
Nr_Purchases='Number of purchase during month'   
Total_Amount_Dollars='Total purchases during month in $'   
; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1666266236598.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76381i23F8D44070C431D0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1666266236598.png" alt="Ksharp_0-1666266236598.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Oct 2022 11:43:32 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2022-10-20T11:43:32Z</dc:date>
    <item>
      <title>Report -stacking values and add label rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Report-stacking-values-and-add-label-rows/m-p/839490#M331923</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to create Report that have same data as the source data set with the following changes:&lt;/P&gt;
&lt;P&gt;1-Values that are repeated in columun "ID"&amp;nbsp; will be displayed as one value&lt;/P&gt;
&lt;P&gt;2-I want to have 2 rows of&amp;nbsp; columns names :&lt;/P&gt;
&lt;P&gt;First row will have the column names&lt;/P&gt;
&lt;P&gt;Second row will have the column label name&lt;/P&gt;
&lt;P&gt;3-I want that for each customer ID will have a thick ourside border (If possible)&lt;/P&gt;
&lt;P&gt;What is the way to do it please?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ronein_0-1666207319656.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76357iF0094A8128838ECB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ronein_0-1666207319656.png" alt="Ronein_0-1666207319656.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;			
Input   ID  month  $   Nr_Purchases Total_Amount_Dollars;			
cards;			
1111 2022-01 10 1000
1111 2022-02 18 1400
1111 2022-03 6 300
1111 2022-04 22 2000
1111 2022-05 19 1300
1111 2022-06 14 1500
2222 2022-01 13 800
2222 2022-02 17 1000
2222 2022-03 4 100
2222 2022-04 12 800
2222 2022-05 10 900
2222 2022-06 27 3000
;			
label 			
ID='Customer ID'			
month='YYYY-MM'			
Nr_Purchases='Number of purchase during month'			
Total_Amount_Dollars='Total purchases during month in $'			
;			
Run;			
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 19:29:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Report-stacking-values-and-add-label-rows/m-p/839490#M331923</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-10-19T19:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: Report -stacking values and add label rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Report-stacking-values-and-add-label-rows/m-p/839494#M331925</link>
      <description>&lt;P&gt;Is the data already summarized, meaning no calculations needed?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Define what you mean by "two rows" of header. Must they physically occupy two different cells of a table or is controlled line wrapping of the output so that it appears that way sufficient?&lt;/P&gt;
&lt;P&gt;Do you expect the program to "automagically" parse the label text from variable characteristics? If so, what if the variable has no label? Do you want the variable name repeated?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: your labels in the data step throw errors. If data is read inline from cards/ datalines then that is the last thing allowed in the step.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 19:39:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Report-stacking-values-and-add-label-rows/m-p/839494#M331925</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-10-19T19:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Report -stacking values and add label rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Report-stacking-values-and-add-label-rows/m-p/839505#M331929</link>
      <description>&lt;P&gt;Please look on the photo that I have attached.&lt;/P&gt;
&lt;P&gt;You can see that under the column names there is another row with column labels .&lt;/P&gt;
&lt;P&gt;IF the variable has no label then display the variable name as the label.&lt;/P&gt;
&lt;P&gt;In this report&amp;nbsp;&lt;SPAN&gt;no calculations needed&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 20:24:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Report-stacking-values-and-add-label-rows/m-p/839505#M331929</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-10-19T20:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: Report -stacking values and add label rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Report-stacking-values-and-add-label-rows/m-p/839611#M331963</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;   
Input   ID  month  $   Nr_Purchases Total_Amount_Dollars;   
cards;   
1111 2022-01 10 1000
1111 2022-02 18 1400
1111 2022-03 6 300
1111 2022-04 22 2000
1111 2022-05 19 1300
1111 2022-06 14 1500
2222 2022-01 13 800
2222 2022-02 17 1000
2222 2022-03 4 100
2222 2022-04 12 800
2222 2022-05 10 900
2222 2022-06 27 3000
;     
Run;

proc report data=have nowd spanrows;
columns ('ID' ID)  ('month' month)    
('Nr_Purchases' Nr_Purchases) ('Total_Amount_Dollars' Total_Amount_Dollars );
define id/order style={vjust=m just=c};
define month/display;

label    
ID='Customer ID'   
month='YYYY-MM'   
Nr_Purchases='Number of purchase during month'   
Total_Amount_Dollars='Total purchases during month in $'   
; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1666266236598.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76381i23F8D44070C431D0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1666266236598.png" alt="Ksharp_0-1666266236598.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 11:43:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Report-stacking-values-and-add-label-rows/m-p/839611#M331963</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-10-20T11:43:32Z</dc:date>
    </item>
  </channel>
</rss>

