<?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: Create SAS table of proportional values which can then be looked up into the transaction line in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-SAS-table-of-proportional-values-which-can-then-be-looked/m-p/205714#M15444</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;This is a sas data set so the data is in SAS format. &lt;/P&gt;&lt;P&gt;I've put formats over the top of it.&amp;nbsp; The picture in the message is just an example rather than the exact format.&amp;nbsp; My dates show in sas as 13W14 for example.&lt;/P&gt;&lt;P&gt;Ages are characters strings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would ideally like to have a list that I can lookup into so that long form that you describe would be ideal (there will be many variables included).&lt;/P&gt;&lt;P&gt;However, I don't know how to get sas to generate this % of the first variable.&lt;/P&gt;&lt;P&gt;I've been playing around with proc freq and the outpct but once I get to 4 variables, it stops working.&amp;nbsp; The overall percent figure generated is inaccurate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My variables are A, B C, D, E,&lt;/P&gt;&lt;P&gt;I need to know what percentage each element of E is of element A.&lt;/P&gt;&lt;P&gt;A in this instance is the week number&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Aug 2015 09:19:20 GMT</pubDate>
    <dc:creator>jjoliver1981</dc:creator>
    <dc:date>2015-08-25T09:19:20Z</dc:date>
    <item>
      <title>Create SAS table of proportional values which can then be looked up into the transaction line</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-SAS-table-of-proportional-values-which-can-then-be-looked/m-p/205711#M15441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to create a table which shows the proportional split by variable in a number of weeks.&amp;nbsp; Easy enough via summary table / proc tabulate.&amp;nbsp; Example below.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-GB; mso-fareast-language: EN-US; mso-bidi-language: AR-SA; mso-bidi-font-family: 'Times New Roman';"&gt;&lt;IMG alt="PropValuesByWeek.png" class="jive-image" src="https://communities.sas.com/legacyfs/online/11448_PropValuesByWeek.png" /&gt;&lt;BR /&gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I then need to be able to lookup the intersection value of week 1 and 45 to 49 and return it into my table data so that every transaction line has the appropriate percentage.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-GB; mso-fareast-language: EN-US; mso-bidi-language: AR-SA; mso-bidi-font-family: 'Times New Roman';"&gt;I'll then use this to reweight my batch of data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-GB; mso-fareast-language: EN-US; mso-bidi-language: AR-SA; mso-bidi-font-family: 'Times New Roman';"&gt;The time periods I have go over a couple of years.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-GB; mso-fareast-language: EN-US; mso-bidi-language: AR-SA; mso-bidi-font-family: 'Times New Roman';"&gt;In excel terms this feels like a lookup with an IF nested, though it's a massive nest.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-GB; mso-fareast-language: EN-US; mso-bidi-language: AR-SA; mso-bidi-font-family: 'Times New Roman';"&gt;I have a workaround which involves exports, calculating in excel and imports but I'd keep it clean in SAS EG.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-GB; mso-fareast-language: EN-US; mso-bidi-language: AR-SA; mso-bidi-font-family: 'Times New Roman';"&gt;Any help is appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-GB; mso-fareast-language: EN-US; mso-bidi-language: AR-SA; mso-bidi-font-family: 'Times New Roman';"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-GB; mso-fareast-language: EN-US; mso-bidi-language: AR-SA; mso-bidi-font-family: 'Times New Roman';"&gt;JJ&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-GB; mso-fareast-language: EN-US; mso-bidi-language: AR-SA; mso-bidi-font-family: 'Times New Roman';"&gt;&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2015 12:40:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-SAS-table-of-proportional-values-which-can-then-be-looked/m-p/205711#M15441</guid>
      <dc:creator>jjoliver1981</dc:creator>
      <dc:date>2015-08-24T12:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: Create SAS table of proportional values which can then be looked up into the transaction line</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-SAS-table-of-proportional-values-which-can-then-be-looked/m-p/205712#M15442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does the "week" imply a year? As in when you compare date such as Jan 1 2012 and Jan 1 2014 are they both in week 1?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What rule are you using for assigning date to week? SAS natively supports 3 different rules, look in the documentation for the function WEEK and descriptors U, V and W.&lt;/P&gt;&lt;P&gt;Are your dates SAS date values?&lt;/P&gt;&lt;P&gt;Are your ages numeric with the value displayed the result of a format or are they those character strings (goes to writing comparison logic)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This may be easier if your lookup data is in the long form of&lt;/P&gt;&lt;P&gt;Age(range) WeekNumber Value &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2015 17:39:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-SAS-table-of-proportional-values-which-can-then-be-looked/m-p/205712#M15442</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-08-24T17:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: Create SAS table of proportional values which can then be looked up into the transaction line</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-SAS-table-of-proportional-values-which-can-then-be-looked/m-p/205713#M15443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's from a SAS data set so yes the dates are in SAS format.&lt;/P&gt;&lt;P&gt;I've put a week format over the top of that to create my week column.&lt;/P&gt;&lt;P&gt;Therefore in your example yes those week 1's are comparable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ages are character strings generated from a format applied with a put.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I absolutely agree it would be easier to have it as a long form, however I do not know in SAS how to so it so that all of week1 adds to 100% then all of week2 adds to 100%.&amp;nbsp; Any advice there is appreciated?&amp;nbsp; Perhaps a version of group by... might work&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Aug 2015 07:09:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-SAS-table-of-proportional-values-which-can-then-be-looked/m-p/205713#M15443</guid>
      <dc:creator>jjoliver1981</dc:creator>
      <dc:date>2015-08-25T07:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Create SAS table of proportional values which can then be looked up into the transaction line</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-SAS-table-of-proportional-values-which-can-then-be-looked/m-p/205714#M15444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;This is a sas data set so the data is in SAS format. &lt;/P&gt;&lt;P&gt;I've put formats over the top of it.&amp;nbsp; The picture in the message is just an example rather than the exact format.&amp;nbsp; My dates show in sas as 13W14 for example.&lt;/P&gt;&lt;P&gt;Ages are characters strings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would ideally like to have a list that I can lookup into so that long form that you describe would be ideal (there will be many variables included).&lt;/P&gt;&lt;P&gt;However, I don't know how to get sas to generate this % of the first variable.&lt;/P&gt;&lt;P&gt;I've been playing around with proc freq and the outpct but once I get to 4 variables, it stops working.&amp;nbsp; The overall percent figure generated is inaccurate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My variables are A, B C, D, E,&lt;/P&gt;&lt;P&gt;I need to know what percentage each element of E is of element A.&lt;/P&gt;&lt;P&gt;A in this instance is the week number&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Aug 2015 09:19:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-SAS-table-of-proportional-values-which-can-then-be-looked/m-p/205714#M15444</guid>
      <dc:creator>jjoliver1981</dc:creator>
      <dc:date>2015-08-25T09:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Create SAS table of proportional values which can then be looked up into the transaction line</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-SAS-table-of-proportional-values-which-can-then-be-looked/m-p/205715#M15445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It may help to print 10 or so lines to show the actual structure of the dataset. Your comment about "adding to %100" makes me think that the example data you showed is not what you are starting with. Describe what you start with and the desired result.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Aug 2015 14:37:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-SAS-table-of-proportional-values-which-can-then-be-looked/m-p/205715#M15445</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-08-25T14:37:07Z</dc:date>
    </item>
  </channel>
</rss>

