<?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: Can multiple functions be used in SAS Enterprise Guide Query Builder in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-multiple-functions-be-used-in-SAS-Enterprise-Guide-Query/m-p/385412#M24835</link>
    <description>&lt;P&gt;In your case, you'd want the CASE statement in your Advanced expression. &amp;nbsp;Something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;case
 when region="X" and balance&amp;lt;100000 then 200
 when region="X" and balance&amp;gt;=100000 then balance*.0025
 when region ^="X" and balance&amp;lt;100000 then 500
 else balance*.005
end /* as NewValue */ &lt;/PRE&gt;
&lt;P&gt;The expression builder will add the "as NewValue" bit on for you, but you'll have to pretty much enter the rest. &amp;nbsp;You can try the Recode Values option instead -- it&amp;nbsp;&lt;STRONG&gt;might&lt;/STRONG&gt; give you some point and click methods for this. &amp;nbsp;The end result would still be a CASE clause.&lt;/P&gt;</description>
    <pubDate>Thu, 03 Aug 2017 17:43:01 GMT</pubDate>
    <dc:creator>ChrisHemedinger</dc:creator>
    <dc:date>2017-08-03T17:43:01Z</dc:date>
    <item>
      <title>Can multiple functions be used in SAS Enterprise Guide Query Builder</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-multiple-functions-be-used-in-SAS-Enterprise-Guide-Query/m-p/385363#M24829</link>
      <description>&lt;P&gt;I have a table of data and need to use one calculation for one region and a different calculation for the other regions.&amp;nbsp; The calculations would include other columns of data.&amp;nbsp; Is it possible to combine functions into one calculated column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data includes Region&amp;nbsp;and&amp;nbsp;Current Balance.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I am trying to accomplish:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the Region = X and the Current Balance is&amp;nbsp;&amp;lt;100,000&amp;nbsp;then the end result is a flat $200. For Region X, if the Current Balance is &amp;gt;100,000 the&amp;nbsp;end result is Current Balance*.0025. For all other Regions&amp;nbsp;if the&amp;nbsp;Current Balance is&amp;nbsp;&amp;lt;100,000&amp;nbsp;then the end result is a flat $500&amp;nbsp;or if the Current Balance is &amp;gt;100,000 then the end result is Current Balance*.005.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I accomplish this? I am not a programmer and need to be able to do this within the Query Builder.&amp;nbsp; Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 15:42:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-multiple-functions-be-used-in-SAS-Enterprise-Guide-Query/m-p/385363#M24829</guid>
      <dc:creator>PNC</dc:creator>
      <dc:date>2017-08-03T15:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can multiple functions be used in SAS Enterprise Guide Query Builder</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-multiple-functions-be-used-in-SAS-Enterprise-Guide-Query/m-p/385384#M24830</link>
      <description>&lt;P&gt;You'd have to do it using the advanced expression option.&amp;nbsp; It kind of walks you thru it a bit, in that the functions are all listed as well as their parameters.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 16:37:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-multiple-functions-be-used-in-SAS-Enterprise-Guide-Query/m-p/385384#M24830</guid>
      <dc:creator>tomrvincent</dc:creator>
      <dc:date>2017-08-03T16:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: Can multiple functions be used in SAS Enterprise Guide Query Builder</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-multiple-functions-be-used-in-SAS-Enterprise-Guide-Query/m-p/385412#M24835</link>
      <description>&lt;P&gt;In your case, you'd want the CASE statement in your Advanced expression. &amp;nbsp;Something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;case
 when region="X" and balance&amp;lt;100000 then 200
 when region="X" and balance&amp;gt;=100000 then balance*.0025
 when region ^="X" and balance&amp;lt;100000 then 500
 else balance*.005
end /* as NewValue */ &lt;/PRE&gt;
&lt;P&gt;The expression builder will add the "as NewValue" bit on for you, but you'll have to pretty much enter the rest. &amp;nbsp;You can try the Recode Values option instead -- it&amp;nbsp;&lt;STRONG&gt;might&lt;/STRONG&gt; give you some point and click methods for this. &amp;nbsp;The end result would still be a CASE clause.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 17:43:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-multiple-functions-be-used-in-SAS-Enterprise-Guide-Query/m-p/385412#M24835</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2017-08-03T17:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: Can multiple functions be used in SAS Enterprise Guide Query Builder</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-multiple-functions-be-used-in-SAS-Enterprise-Guide-Query/m-p/388970#M25087</link>
      <description>&lt;P&gt;Thank you!&amp;nbsp; I haven't had a chance to see if this will work yet, but I believe it will do what I need.&amp;nbsp; I appreciate the help.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 21:21:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-multiple-functions-be-used-in-SAS-Enterprise-Guide-Query/m-p/388970#M25087</guid>
      <dc:creator>PNC</dc:creator>
      <dc:date>2017-08-17T21:21:18Z</dc:date>
    </item>
  </channel>
</rss>

