<?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 Trying to format my final table in a very specific format in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Trying-to-format-my-final-table-in-a-very-specific-format/m-p/923047#M41408</link>
    <description>&lt;P&gt;I am creating a budget and want to format the finished product in one table like the one pictured. I have created four tables with one row and three columns each. I want SAS to output the data as one table in the format pictured in the attached file if that is possible.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have following data from the four tables with one row and three columns each and need present the following four things:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; -&amp;nbsp; Current month budgeted expenses vs actual expenses and variance between the two&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; - Current month actual expenses from the prior year compared to current month actual expenses for the current year&amp;nbsp;and variance between the two&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; - Year to Date Budgeted vs actual expenses for the current year and variance between the two&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; - Year to Date Budgeted expenses from the prior year compared to year to date expenses&amp;nbsp;and variance between the two&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each table would look something like this: Budgeted Month Expenses, Actual Month Expenses, Variance&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to format them into one table like the one attached for presentation purposes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Apr 2024 20:52:25 GMT</pubDate>
    <dc:creator>CSB35</dc:creator>
    <dc:date>2024-04-04T20:52:25Z</dc:date>
    <item>
      <title>Trying to format my final table in a very specific format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Trying-to-format-my-final-table-in-a-very-specific-format/m-p/923047#M41408</link>
      <description>&lt;P&gt;I am creating a budget and want to format the finished product in one table like the one pictured. I have created four tables with one row and three columns each. I want SAS to output the data as one table in the format pictured in the attached file if that is possible.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have following data from the four tables with one row and three columns each and need present the following four things:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; -&amp;nbsp; Current month budgeted expenses vs actual expenses and variance between the two&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; - Current month actual expenses from the prior year compared to current month actual expenses for the current year&amp;nbsp;and variance between the two&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; - Year to Date Budgeted vs actual expenses for the current year and variance between the two&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; - Year to Date Budgeted expenses from the prior year compared to year to date expenses&amp;nbsp;and variance between the two&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each table would look something like this: Budgeted Month Expenses, Actual Month Expenses, Variance&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to format them into one table like the one attached for presentation purposes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 20:52:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Trying-to-format-my-final-table-in-a-very-specific-format/m-p/923047#M41408</guid>
      <dc:creator>CSB35</dc:creator>
      <dc:date>2024-04-04T20:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to format my final table in a very specific format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Trying-to-format-my-final-table-in-a-very-specific-format/m-p/923049#M41409</link>
      <description>&lt;P&gt;Many of us refuse to download Microsoft Office files, as they can be a security threat. If you want to show us the layout of a table you would like, make a screen capture and include it in your reply using the "Insert Photos" icon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please also provide sample data, as working SAS data step code (&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;examples and instructions&lt;/A&gt;).&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 21:16:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Trying-to-format-my-final-table-in-a-very-specific-format/m-p/923049#M41409</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-04-04T21:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to format my final table in a very specific format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Trying-to-format-my-final-table-in-a-very-specific-format/m-p/923051#M41410</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Budget_Format.JPG" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95218i87519030A330536C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Budget_Format.JPG" alt="Budget_Format.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you for the valuable information! Here is a screen capture&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 21:18:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Trying-to-format-my-final-table-in-a-very-specific-format/m-p/923051#M41410</guid>
      <dc:creator>CSB35</dc:creator>
      <dc:date>2024-04-04T21:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to format my final table in a very specific format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Trying-to-format-my-final-table-in-a-very-specific-format/m-p/923052#M41411</link>
      <description>&lt;PRE&gt;Here is the code I used to generate the four tables:&lt;BR /&gt;&lt;BR /&gt;/*Month CY Budget and Actual*/
PROC  SQL;
	CREATE Table WORK.Month_CYBudtoActuals as 
	SELECT Sum('Budgeted Month'n) as CYBudMonth,
	Sum('Monthly Actuals'n) as CYActMonth
	FROM WORK.CYBUDGETTOCYACTUALS

Quit;

PROC  SQL;
	CREATE Table WORK.Month_CYBudtoActuals as 
	SELECT CYBudMonth, CYActMonth,
	(CYBudMonth - CYActMonth) as '$ Variance'n
	FROM WORK.Month_CYBudtoActuals

Quit;

/*Month PY Actual, CY Actual*/
PROC  SQL;
	CREATE Table WORK.Month_PYtoCYActuals as 
	SELECT Sum('Month PY Actuals'n) as 'PY Month Actual'n,
	Sum('CY Actuals'n) as 'CY Month Actual'n
	FROM WORK.PYACTUALSTOCYACTUALS

Quit;

PROC SQL;
	CREATE TABLE Work.Month_PYtoCYActuals as
	SELECT 'PY Month Actual'n, 'CY Month Actual'n,
	('PY Month Actual'n - 'CY Month Actual'n) as '$ Variance'n
	FROM WORK.Month_PYtoCYActuals

Quit;

/*YTD CY bud and act*/
PROC SQL;
	CREATE Table WORK.YTD_CYBudtoActual as 
	SELECT Sum('Budgeted Month'n) as 'CY YTD Bud'n,
	Sum('Monthly Actuals'n) as 'CY YTD Actual'n
	FROM WORK.CYBUDGETTOACTUALS_YTD

Quit;

PROC SQL;
	CREATE Table WORK.YTD_CYBudtoActual as 
	SELECT 'CY YTD Bud'n, 'CY YTD Actual'n,
	('CY YTD Bud'n - 'CY YTD Actual'n) as '$ Variance'n
	FROM WORK.YTD_CYBudtoActual

Quit;

/*YTD PY act. vs CY act.*/
PROC SQL;
	CREATE table WORK.YTD_PYtoCY_Actuals as
	SELECT Sum('PY YTD Actuals'n) as 'PY YTD Actual'n,
	Sum('CY Actuals'n) as 'CY YTD Actual'n
	FROM WORK.PYTOCY_ACTUALS_YTD

Quit;

PROC SQL;
	CREATE table WORK.YTD_PYtoCY_Actuals as
	SELECT 'PY YTD Actual'n, 'CY YTD Actual'n,
	('PY YTD Actual'n - 'CY YTD Actual'n) as '$ Variance'n
	FROM WORK.YTD_PYtoCY_Actuals
Quit;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Apr 2024 21:21:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Trying-to-format-my-final-table-in-a-very-specific-format/m-p/923052#M41411</guid>
      <dc:creator>CSB35</dc:creator>
      <dc:date>2024-04-04T21:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to format my final table in a very specific format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Trying-to-format-my-final-table-in-a-very-specific-format/m-p/923053#M41412</link>
      <description>&lt;P&gt;I also requested sample data, provided as working SAS data step code (&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self" rel="nofollow noopener noreferrer"&gt;examples and instructions&lt;/A&gt;).&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 21:23:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Trying-to-format-my-final-table-in-a-very-specific-format/m-p/923053#M41412</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-04-04T21:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to format my final table in a very specific format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Trying-to-format-my-final-table-in-a-very-specific-format/m-p/923056#M41413</link>
      <description>&lt;P&gt;I have some of my code in an earlier reply, here is one of the four tables. They all have a similar format&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sample_Data.JPG" style="width: 338px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95220iDF4ED14B48D8EC25/image-size/large?v=v2&amp;amp;px=999" role="button" title="Sample_Data.JPG" alt="Sample_Data.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 21:30:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Trying-to-format-my-final-table-in-a-very-specific-format/m-p/923056#M41413</guid>
      <dc:creator>CSB35</dc:creator>
      <dc:date>2024-04-04T21:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to format my final table in a very specific format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Trying-to-format-my-final-table-in-a-very-specific-format/m-p/923057#M41414</link>
      <description>&lt;P&gt;Data means something that we can run code with.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the &amp;lt;/&amp;gt; icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since your code is using multiple different source data sets then you would need to provide examples of each.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You also don't provide much guidance, as in any, as to what value goes where. Building a table should reference what variable(s) are used to build which column and/or row.&lt;/P&gt;
&lt;P&gt;I have no way to tell from your picture showing a desired column headings MTD and YTD (NOT variables used anywhere in your code) or where "2024 Budget" and "2024 Actual" come from. I can make some sort of educated guesses because I've been programming for a while. But I also know from that experience that "guessing" is a very poor way to set rules for coding.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One has suspicion that this is part way through a process that split up an existing data set to get some summary values and now is looking to get put back together for the report. If this is indeed the case, then it may be better idea to provide an example of that earlier data set.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 22:01:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Trying-to-format-my-final-table-in-a-very-specific-format/m-p/923057#M41414</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-04-04T22:01:01Z</dc:date>
    </item>
  </channel>
</rss>

