<?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 Select value over multiple nested conditions in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Select-value-over-multiple-nested-conditions/m-p/208078#M13795</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can i select a correct Group_ID who has to be satisfied following conditions:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;1a) If # of visits = 1 then select "TIE" Group_ID with most recent Max_date&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;1b) else If # of visits = 1 AND Max_date is the same date then select "TIE" Group_ID with greatest Cost &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 1c) else If # of visits = 1 AND most recent Max_date is the same date AND Cost is the same then leave blank&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 2a) else if # of visits &amp;gt; 1 then select "TIE" Group_ID with greatest time &lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;2b) else If # of visits &amp;gt; 1 AND Time is equal then select "TIE" Group_ID with Max_date .&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;2c)&amp;nbsp; else If # of visits &amp;gt; 1 AND time is equal AND the Max_date is the same then select "TIE" Group_ID with greatest Cost.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;2d) else If # of visits &amp;gt; 1 AND length of time between first and last E&amp;amp;M visits is equal AND the Max_date is the same AND the Cost are the same then leave blank.&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 522px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl69" height="19" width="64"&gt;ID&lt;/TD&gt;&lt;TD class="xl69" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="64"&gt;Period &lt;/TD&gt;&lt;TD class="xl69" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="64"&gt;Group_ID&lt;/TD&gt;&lt;TD class="xl69" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="64"&gt;EM counts&lt;/TD&gt;&lt;TD class="xl69" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="64"&gt;Min_date&lt;/TD&gt;&lt;TD class="xl69" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="74"&gt;Max_date&lt;/TD&gt;&lt;TD class="xl69" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="64"&gt;Cost&lt;/TD&gt;&lt;TD class="xl69" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="64"&gt;time&lt;/TD&gt; &lt;/TR&gt; My data is below:&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;AAA&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;4Q4936&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;2/3/2015&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;2/4/2015&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;AAA&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;66532&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;24/9/2014&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;24/9/2015&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;AAA&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;66532&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;22/7/2013&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;7/3/2014&lt;/TD&gt;&lt;TD class="xl67" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;$228 &lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;228&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;AAA&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;454936&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;28/2/2014&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;28/2/2014&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;AAA&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;4Q4936&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;8/1/2013&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;8/2/2013&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;AAA&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;3&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1829&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;26&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;5/5/2014&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;28/4/2015&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;358&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;AAA&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;3&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1825&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;26&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;15/5/2014&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;28/4/2015&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;358&lt;/TD&gt;&lt;TD class="xl68" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;348.00&lt;/TD&gt; &lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Aug 2015 18:19:54 GMT</pubDate>
    <dc:creator>vivudao</dc:creator>
    <dc:date>2015-08-26T18:19:54Z</dc:date>
    <item>
      <title>Select value over multiple nested conditions</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Select-value-over-multiple-nested-conditions/m-p/208078#M13795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can i select a correct Group_ID who has to be satisfied following conditions:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;1a) If # of visits = 1 then select "TIE" Group_ID with most recent Max_date&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;1b) else If # of visits = 1 AND Max_date is the same date then select "TIE" Group_ID with greatest Cost &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 1c) else If # of visits = 1 AND most recent Max_date is the same date AND Cost is the same then leave blank&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 2a) else if # of visits &amp;gt; 1 then select "TIE" Group_ID with greatest time &lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;2b) else If # of visits &amp;gt; 1 AND Time is equal then select "TIE" Group_ID with Max_date .&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;2c)&amp;nbsp; else If # of visits &amp;gt; 1 AND time is equal AND the Max_date is the same then select "TIE" Group_ID with greatest Cost.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;2d) else If # of visits &amp;gt; 1 AND length of time between first and last E&amp;amp;M visits is equal AND the Max_date is the same AND the Cost are the same then leave blank.&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 522px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl69" height="19" width="64"&gt;ID&lt;/TD&gt;&lt;TD class="xl69" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="64"&gt;Period &lt;/TD&gt;&lt;TD class="xl69" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="64"&gt;Group_ID&lt;/TD&gt;&lt;TD class="xl69" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="64"&gt;EM counts&lt;/TD&gt;&lt;TD class="xl69" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="64"&gt;Min_date&lt;/TD&gt;&lt;TD class="xl69" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="74"&gt;Max_date&lt;/TD&gt;&lt;TD class="xl69" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="64"&gt;Cost&lt;/TD&gt;&lt;TD class="xl69" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="64"&gt;time&lt;/TD&gt; &lt;/TR&gt; My data is below:&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;AAA&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;4Q4936&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;2/3/2015&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;2/4/2015&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;AAA&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;66532&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;24/9/2014&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;24/9/2015&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;AAA&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;66532&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;22/7/2013&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;7/3/2014&lt;/TD&gt;&lt;TD class="xl67" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;$228 &lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;228&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;AAA&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;454936&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;28/2/2014&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;28/2/2014&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;AAA&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;4Q4936&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;8/1/2013&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;8/2/2013&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;AAA&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;3&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1829&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;26&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;5/5/2014&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;28/4/2015&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;358&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;AAA&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;3&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1825&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;26&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;15/5/2014&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;28/4/2015&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;358&lt;/TD&gt;&lt;TD class="xl68" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;348.00&lt;/TD&gt; &lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Aug 2015 18:19:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Select-value-over-multiple-nested-conditions/m-p/208078#M13795</guid>
      <dc:creator>vivudao</dc:creator>
      <dc:date>2015-08-26T18:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: Select value over multiple nested conditions</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Select-value-over-multiple-nested-conditions/m-p/208079#M13796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First thing: Define "visit"&lt;/P&gt;&lt;P&gt;Second: how do we identify " "TIE" Group_ID"&lt;/P&gt;&lt;P&gt;Third: "Max_date is the same" same as ? Max_date or Min_date&lt;/P&gt;&lt;P&gt;Fourth: "AND Time is equal" equal to what, assumes you mean value to time but which ones may not be obvious&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For you example data, what would the output look like?&lt;/P&gt;&lt;P&gt;If you don't have an example of each case of your conditions it can be hard to test code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Aug 2015 19:38:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Select-value-over-multiple-nested-conditions/m-p/208079#M13796</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-08-26T19:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: Select value over multiple nested conditions</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Select-value-over-multiple-nested-conditions/m-p/208080#M13797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First thing: Define "visit" ----Visit is EM count&lt;/P&gt;&lt;P&gt;Second: how do we identify " "TIE" Group_ID" ---TIE is having same EM counts, or Max_date, or Cost or Time&lt;/P&gt;&lt;P&gt;Third: "Max_date is the same" same as ? Max_date or Min_date-----Max_date is the same as Max_date&lt;/P&gt;&lt;P&gt;Fourth: "AND Time is equal" equal to what, assumes you mean value to time but which ones may not be obvious ---Time is calculated by the Max_date substract Min_date&lt;/P&gt;&lt;P&gt;My output is to find the &lt;STRONG&gt;winner group ID for each period&lt;/STRONG&gt;.&amp;nbsp; for example, in period 1 both group IDs had same EM counts of 1, then follow rule 1a and 1b&amp;nbsp; the second one has most recent Max_date, so the Group ID= 66532 is the winner for period 1, and so on...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if it's still not clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;V.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Aug 2015 20:18:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Select-value-over-multiple-nested-conditions/m-p/208080#M13797</guid>
      <dc:creator>vivudao</dc:creator>
      <dc:date>2015-08-26T20:18:21Z</dc:date>
    </item>
  </channel>
</rss>

