<?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 How to get max value from unit in a month in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-max-value-from-unit-in-a-month/m-p/81015#M23365</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi need assistance with a table that was imported into SAS the table has 3 columns &lt;/P&gt;&lt;P&gt;unit 1.&amp;nbsp; $100 05/01/12&lt;/P&gt;&lt;P&gt;unit 2.&amp;nbsp; $59.&amp;nbsp;&amp;nbsp; 05/12/12&lt;/P&gt;&lt;P&gt;unit 2.&amp;nbsp;&amp;nbsp; 33.&amp;nbsp;&amp;nbsp; 05/13/12&lt;/P&gt;&lt;P&gt;unit 3.&amp;nbsp;&amp;nbsp; $ 60.&amp;nbsp; 05 /12/12&lt;/P&gt;&lt;P&gt;unit 3.&amp;nbsp; 55.&amp;nbsp;&amp;nbsp; 05/20/12&lt;/P&gt;&lt;P&gt;unit 1 $25 05/05/12&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what I need is to Id only the max $ value by date &lt;/P&gt;&lt;P&gt;THis is what I'm looking for &lt;/P&gt;&lt;P&gt;unit 1 $100 05/01/12&lt;/P&gt;&lt;P&gt;unit 2 $59 05/12/12&lt;/P&gt;&lt;P&gt;unit 3 $60 05/12/12&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what is coming up is max value for each day which brings everything in...thank you for you assistance &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 May 2013 23:31:50 GMT</pubDate>
    <dc:creator>BETO</dc:creator>
    <dc:date>2013-05-20T23:31:50Z</dc:date>
    <item>
      <title>How to get max value from unit in a month</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-max-value-from-unit-in-a-month/m-p/81015#M23365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi need assistance with a table that was imported into SAS the table has 3 columns &lt;/P&gt;&lt;P&gt;unit 1.&amp;nbsp; $100 05/01/12&lt;/P&gt;&lt;P&gt;unit 2.&amp;nbsp; $59.&amp;nbsp;&amp;nbsp; 05/12/12&lt;/P&gt;&lt;P&gt;unit 2.&amp;nbsp;&amp;nbsp; 33.&amp;nbsp;&amp;nbsp; 05/13/12&lt;/P&gt;&lt;P&gt;unit 3.&amp;nbsp;&amp;nbsp; $ 60.&amp;nbsp; 05 /12/12&lt;/P&gt;&lt;P&gt;unit 3.&amp;nbsp; 55.&amp;nbsp;&amp;nbsp; 05/20/12&lt;/P&gt;&lt;P&gt;unit 1 $25 05/05/12&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what I need is to Id only the max $ value by date &lt;/P&gt;&lt;P&gt;THis is what I'm looking for &lt;/P&gt;&lt;P&gt;unit 1 $100 05/01/12&lt;/P&gt;&lt;P&gt;unit 2 $59 05/12/12&lt;/P&gt;&lt;P&gt;unit 3 $60 05/12/12&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what is coming up is max value for each day which brings everything in...thank you for you assistance &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 May 2013 23:31:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-max-value-from-unit-in-a-month/m-p/81015#M23365</guid>
      <dc:creator>BETO</dc:creator>
      <dc:date>2013-05-20T23:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to get max value from unit in a month</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-max-value-from-unit-in-a-month/m-p/81016#M23366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data have;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;input @5 unit value :comma5. date : mmddyy8.;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;format date date9.;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;unit 1.&amp;nbsp; $100 05/01/12&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;unit 2.&amp;nbsp; $59.&amp;nbsp;&amp;nbsp; 05/12/12&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;unit 2.&amp;nbsp;&amp;nbsp; 33.&amp;nbsp;&amp;nbsp; 05/13/12&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;unit 3.&amp;nbsp;&amp;nbsp; $60.&amp;nbsp; 05/12/12&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;unit 3.&amp;nbsp; 55.&amp;nbsp;&amp;nbsp; 05/20/12&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;unit 1 $25&amp;nbsp; 05/05/12&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;create table want as&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;select &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; unit, &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; intnx("MONTH",date,0) as month format = yymmd7., &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;from have&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;group by &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; unit, &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; calculated month&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;having value=max(value);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;select * from want;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 00:13:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-max-value-from-unit-in-a-month/m-p/81016#M23366</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-05-21T00:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to get max value from unit in a month</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-max-value-from-unit-in-a-month/m-p/81017#M23367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI PGStats,&lt;/P&gt;&lt;P&gt;thanks you&amp;nbsp; for responding to my question. It's real close you script did bring out the max value and the unit # the only thing that is missing is the&amp;nbsp; date&amp;nbsp; of when the max value occurred . what appear is the month 05/2012. I need the date brought over with it&amp;nbsp; when it hit max value...thanks again for assistance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 03:55:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-max-value-from-unit-in-a-month/m-p/81017#M23367</guid>
      <dc:creator>BETO</dc:creator>
      <dc:date>2013-05-21T03:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to get max value from unit in a month</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-max-value-from-unit-in-a-month/m-p/81018#M23368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;What about this ???&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;proc sort data = have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; by unit value;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;data want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; set have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; by unit value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; if last.unit and last.value then output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Hope it meets your requirement...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;-Urvish&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 06:51:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-max-value-from-unit-in-a-month/m-p/81018#M23368</guid>
      <dc:creator>UrvishShah</dc:creator>
      <dc:date>2013-05-21T06:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to get max value from unit in a month</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-max-value-from-unit-in-a-month/m-p/81019#M23369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Simply add the date to the list of fields that you want :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table maxValue as&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; unit, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; intnx("MONTH",date,0) as month format = yymmd7., &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;from have&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;group by &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; unit, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; calculated month&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;having value=max(value);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select * from maxValue;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 14:34:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-max-value-from-unit-in-a-month/m-p/81019#M23369</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-05-21T14:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to get max value from unit in a month</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-max-value-from-unit-in-a-month/m-p/81020#M23370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI PGStats,&lt;/P&gt;&lt;P&gt;thank you for help.&amp;nbsp; I must be doing something wrong because when I run the script it doesn't give me the highest usage $ per day of the month select. It gives me lowest Amt. what do you think is causing that that? Thanks again for all your help &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2013 21:45:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-max-value-from-unit-in-a-month/m-p/81020#M23370</guid>
      <dc:creator>BETO</dc:creator>
      <dc:date>2013-05-31T21:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to get max value from unit in a month</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-max-value-from-unit-in-a-month/m-p/81021#M23371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you sure VALUE is a numeric variable?&amp;nbsp; If it is character then it will take the max when sorting alphabetically.&amp;nbsp; So '9' would be "greater" then '1000'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2013 21:59:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-max-value-from-unit-in-a-month/m-p/81021#M23371</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-05-31T21:59:41Z</dc:date>
    </item>
  </channel>
</rss>

