<?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: Return max value from a row in SAS Customer Intelligence</title>
    <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/Return-max-value-from-a-row/m-p/811362#M1795</link>
    <description>&lt;P&gt;Perhaps LARGEST() is the SQL function that would do this for you (although you will need to confirm its available in CI Studio). In a calculated item create an expression like: LARGEST(1,&amp;nbsp;&lt;SPAN&gt;Scoring_Var1,&amp;nbsp;Scoring_Var2,&amp;nbsp;Scoring_Var3)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;James&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 04 May 2022 05:09:41 GMT</pubDate>
    <dc:creator>JamesAnderson</dc:creator>
    <dc:date>2022-05-04T05:09:41Z</dc:date>
    <item>
      <title>Return max value from a row</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/Return-max-value-from-a-row/m-p/811312#M1793</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope everyone is doing well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is an example of an output from SAS MA export node&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;CUSTOMER_ID&lt;/TD&gt;
&lt;TD width="25%"&gt;Scoring_Var1&lt;/TD&gt;
&lt;TD width="25%"&gt;Scoring_Var2&lt;/TD&gt;
&lt;TD width="25%"&gt;Scoring_Var3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;CUST0000001&lt;/TD&gt;
&lt;TD width="25%"&gt;0.98765&lt;/TD&gt;
&lt;TD width="25%"&gt;0.01234&lt;/TD&gt;
&lt;TD width="25%"&gt;0.99999&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Question: is there a way to create a calculated field that will return the max(Scoring_Var)&amp;nbsp; for each row.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 20:05:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/Return-max-value-from-a-row/m-p/811312#M1793</guid>
      <dc:creator>keiwo</dc:creator>
      <dc:date>2022-05-03T20:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: Return max value from a row</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/Return-max-value-from-a-row/m-p/811315#M1794</link>
      <description>&lt;P&gt;Here's one way, using an array, that is suitable for any number of&amp;nbsp;&lt;EM&gt;scoring_var#&amp;nbsp;&lt;/EM&gt;columns you have.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
    input customer_id $12. scoring_var1 scoring_var2 scoring_var3;
    datalines;
CUST0000001 0.98765 0.01234 0.99999
CUST0000002 0.87654 0.76543 0.54321
    ;
run;

data want;
    set have;
    array scoring_columns scoring_var:;
    max = max(of scoring_columns[*]);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;For more details, or to see a few other methods, see &lt;A href="https://sasexamplecode.com/how-to-find-the-maximum-value-of-a-row-in-sas/#How_to_Find_the_Maximum_Value_Across_Multiple_Columns_with_the_Same_Name" target="_self"&gt;this link&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 21:03:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/Return-max-value-from-a-row/m-p/811315#M1794</guid>
      <dc:creator>mklangley</dc:creator>
      <dc:date>2022-05-03T21:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: Return max value from a row</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/Return-max-value-from-a-row/m-p/811362#M1795</link>
      <description>&lt;P&gt;Perhaps LARGEST() is the SQL function that would do this for you (although you will need to confirm its available in CI Studio). In a calculated item create an expression like: LARGEST(1,&amp;nbsp;&lt;SPAN&gt;Scoring_Var1,&amp;nbsp;Scoring_Var2,&amp;nbsp;Scoring_Var3)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;James&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 05:09:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/Return-max-value-from-a-row/m-p/811362#M1795</guid>
      <dc:creator>JamesAnderson</dc:creator>
      <dc:date>2022-05-04T05:09:41Z</dc:date>
    </item>
  </channel>
</rss>

