<?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 Create Aggregate Measures with filter criteria in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Create-Aggregate-Measures-with-filter-criteria/m-p/422721#M9002</link>
    <description>&lt;P&gt;How can we create&amp;nbsp;multiple aggregate measures from the same table based on different filter criteria such as follows in the same Report Designer in SAS VA:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;select distinct count(id) from abc where type in ('A','C') and month=month(today())-1&lt;/P&gt;
&lt;P&gt;select sum(amount) from abc where type in ('A','C') and country='US'&lt;/P&gt;
&lt;P&gt;select sum(c_bal) from abc where type in ('C') and region = 'NE'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm able to create aggregate measure but not finding filter criteria.&amp;nbsp; When I'm filtering it's applying on the whole job in the designer.&amp;nbsp; I just need to limit filter criteria for one aggregate measure only as I need to create multiple aggregate measure with different filter criteria.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any insight would be helpful and thanks in advance !&lt;/P&gt;</description>
    <pubDate>Wed, 20 Dec 2017 15:20:35 GMT</pubDate>
    <dc:creator>SAS_1001</dc:creator>
    <dc:date>2017-12-20T15:20:35Z</dc:date>
    <item>
      <title>Create Aggregate Measures with filter criteria</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Create-Aggregate-Measures-with-filter-criteria/m-p/422721#M9002</link>
      <description>&lt;P&gt;How can we create&amp;nbsp;multiple aggregate measures from the same table based on different filter criteria such as follows in the same Report Designer in SAS VA:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;select distinct count(id) from abc where type in ('A','C') and month=month(today())-1&lt;/P&gt;
&lt;P&gt;select sum(amount) from abc where type in ('A','C') and country='US'&lt;/P&gt;
&lt;P&gt;select sum(c_bal) from abc where type in ('C') and region = 'NE'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm able to create aggregate measure but not finding filter criteria.&amp;nbsp; When I'm filtering it's applying on the whole job in the designer.&amp;nbsp; I just need to limit filter criteria for one aggregate measure only as I need to create multiple aggregate measure with different filter criteria.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any insight would be helpful and thanks in advance !&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 15:20:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Create-Aggregate-Measures-with-filter-criteria/m-p/422721#M9002</guid>
      <dc:creator>SAS_1001</dc:creator>
      <dc:date>2017-12-20T15:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: Create Aggregate Measures with filter criteria</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Create-Aggregate-Measures-with-filter-criteria/m-p/423274#M9024</link>
      <description>&lt;P&gt;I think you could use the IF...THEN....ELSE:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First one:&lt;/P&gt;
&lt;P&gt;Create a new calculated meassure:&lt;/P&gt;
&lt;P&gt;IF type in ('A', 'C') and month = month(today())-1 then id else . You need to adjust the syntax in VA &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then create a distinct count on this variable&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;IF type in ('A', 'C') and country = 'US' then 1 else 0&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Add sum as aggregation on the meassure.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Third:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;IF type in ('C') and&amp;nbsp;region = 'NE' then 1 else 0&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Add sum as aggregation on the meassure.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;//Fredrik&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2017 08:04:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Create-Aggregate-Measures-with-filter-criteria/m-p/423274#M9024</guid>
      <dc:creator>FredrikE</dc:creator>
      <dc:date>2017-12-22T08:04:52Z</dc:date>
    </item>
  </channel>
</rss>

