<?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 Juletip #2 - How to calculate AVG, MIN, MAX, etc… for aggregated measures in VA? in SAS Community Nordic</title>
    <link>https://communities.sas.com/t5/SAS-Community-Nordic/Juletip-2-How-to-calculate-AVG-MIN-MAX-etc-for-aggregated/m-p/702987#M311</link>
    <description>&lt;P&gt;Have you ever seen the error message “&lt;FONT color="#993300"&gt;Nested aggregated expressions are not supported&lt;/FONT&gt;”? Well, I have. When you are doing a little bit more advanced &lt;EM&gt;New Calculated Items&lt;/EM&gt; in VA you might bump into this road blocker and wonder how to get around it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem is that VA doesn't currently allow nested aggregated expressions i.e. when you are creating a &lt;EM&gt;New Calculated Item&lt;/EM&gt; you can’t use &lt;EM&gt;Aggregated measure&lt;/EM&gt; inside an &lt;EM&gt;Aggregate operator&lt;/EM&gt; (see dummy example below).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PetriRoine_0-1606892517185.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/52241iCB59ED9319B55E87/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PetriRoine_0-1606892517185.png" alt="PetriRoine_0-1606892517185.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, you can often use alternative approach to get things done, namely using an&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=vacdc&amp;amp;cdcVersion=8.5&amp;amp;docsetId=vareportdata&amp;amp;docsetTarget=n1o2pvak2xw7jln13a2mxkytdmm4.htm&amp;amp;locale=en"&gt;aggregated data source&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;VA 8.3 introduced capability to&amp;nbsp;create an&amp;nbsp;&lt;EM&gt;aggregated data source&lt;/EM&gt;&amp;nbsp;which allows us to create &lt;EM&gt;aggregated measures&lt;/EM&gt;&amp;nbsp;without using &lt;EM&gt;aggregate operator&lt;/EM&gt;. Looking at the picture above you could f.ex. create &lt;FONT face="courier new,courier"&gt;Population (AVG)&lt;/FONT&gt; by using &lt;EM&gt;Aggregated data source&lt;/EM&gt; instead of using &lt;EM&gt;New Calculated Item&lt;/EM&gt; and &lt;EM&gt;Aggregate Operator&lt;/EM&gt;&lt;STRONG&gt;. &lt;/STRONG&gt;&lt;FONT face="courier new,courier"&gt;Population (AVG)&lt;/FONT&gt;&amp;nbsp;created this ways allows you to use it inside &lt;EM&gt;Aggregate Operator&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#993300"&gt;!!!&lt;/FONT&gt; Note that &lt;EM&gt;Aggregated Data Sources&lt;/EM&gt; support &lt;EM&gt;Aggregated (simple)&lt;/EM&gt; and &lt;EM&gt;Aggregated (advanced)&lt;/EM&gt; operators, but not the &lt;EM&gt;Aggregated (periodic)&lt;/EM&gt; operators.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to create aggregated data source&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;In the&amp;nbsp;&lt;STRONG&gt;Data&lt;/STRONG&gt;&amp;nbsp;pane, select a data source.&lt;/LI&gt;
&lt;LI&gt;Click&amp;nbsp;&lt;STRONG&gt;Action&lt;/STRONG&gt;&amp;nbsp;icon&amp;nbsp;and then select&amp;nbsp;&lt;STRONG&gt;New data from aggregation of&amp;nbsp;&lt;EM&gt;data-source&lt;/EM&gt;&lt;/STRONG&gt;. The New Aggregated Data window is displayed.&lt;/LI&gt;
&lt;LI&gt;Select the data items&amp;nbsp;to add to the aggregated data source in the&amp;nbsp;&lt;STRONG&gt;Available items&lt;/STRONG&gt;&amp;nbsp;list.&amp;nbsp;Then, click&amp;nbsp;&lt;STRONG&gt;+&amp;gt;&amp;nbsp;&lt;/STRONG&gt;to move it to the&amp;nbsp;&lt;STRONG&gt;Selected items&lt;/STRONG&gt;&amp;nbsp;list.&lt;/LI&gt;
&lt;LI&gt;(Optional) Change the name of the aggregated data source in the&amp;nbsp;Name&amp;nbsp;field.&lt;/LI&gt;
&lt;LI&gt;Click&amp;nbsp;&lt;STRONG&gt;Ok.&amp;nbsp;&lt;/STRONG&gt;The new aggregated data source is available in the&amp;nbsp;&lt;STRONG&gt;Data&lt;/STRONG&gt;&amp;nbsp;pane.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Now your new data source has &lt;EM&gt;aggregated measures&lt;/EM&gt; of which aggregation you can define normally to be SUM|AVG|MIN|MAX|etc... and also utilize inside &lt;EM&gt;Aggregate Operators&lt;/EM&gt; when creating new calculated items.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may utilize your new measures directly by utilizing the new aggregated data source or by joining the aggregated measures to your original table.&lt;/P&gt;</description>
    <pubDate>Wed, 02 Dec 2020 07:08:07 GMT</pubDate>
    <dc:creator>PetriRoine</dc:creator>
    <dc:date>2020-12-02T07:08:07Z</dc:date>
    <item>
      <title>Juletip #2 - How to calculate AVG, MIN, MAX, etc… for aggregated measures in VA?</title>
      <link>https://communities.sas.com/t5/SAS-Community-Nordic/Juletip-2-How-to-calculate-AVG-MIN-MAX-etc-for-aggregated/m-p/702987#M311</link>
      <description>&lt;P&gt;Have you ever seen the error message “&lt;FONT color="#993300"&gt;Nested aggregated expressions are not supported&lt;/FONT&gt;”? Well, I have. When you are doing a little bit more advanced &lt;EM&gt;New Calculated Items&lt;/EM&gt; in VA you might bump into this road blocker and wonder how to get around it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem is that VA doesn't currently allow nested aggregated expressions i.e. when you are creating a &lt;EM&gt;New Calculated Item&lt;/EM&gt; you can’t use &lt;EM&gt;Aggregated measure&lt;/EM&gt; inside an &lt;EM&gt;Aggregate operator&lt;/EM&gt; (see dummy example below).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PetriRoine_0-1606892517185.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/52241iCB59ED9319B55E87/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PetriRoine_0-1606892517185.png" alt="PetriRoine_0-1606892517185.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, you can often use alternative approach to get things done, namely using an&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=vacdc&amp;amp;cdcVersion=8.5&amp;amp;docsetId=vareportdata&amp;amp;docsetTarget=n1o2pvak2xw7jln13a2mxkytdmm4.htm&amp;amp;locale=en"&gt;aggregated data source&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;VA 8.3 introduced capability to&amp;nbsp;create an&amp;nbsp;&lt;EM&gt;aggregated data source&lt;/EM&gt;&amp;nbsp;which allows us to create &lt;EM&gt;aggregated measures&lt;/EM&gt;&amp;nbsp;without using &lt;EM&gt;aggregate operator&lt;/EM&gt;. Looking at the picture above you could f.ex. create &lt;FONT face="courier new,courier"&gt;Population (AVG)&lt;/FONT&gt; by using &lt;EM&gt;Aggregated data source&lt;/EM&gt; instead of using &lt;EM&gt;New Calculated Item&lt;/EM&gt; and &lt;EM&gt;Aggregate Operator&lt;/EM&gt;&lt;STRONG&gt;. &lt;/STRONG&gt;&lt;FONT face="courier new,courier"&gt;Population (AVG)&lt;/FONT&gt;&amp;nbsp;created this ways allows you to use it inside &lt;EM&gt;Aggregate Operator&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#993300"&gt;!!!&lt;/FONT&gt; Note that &lt;EM&gt;Aggregated Data Sources&lt;/EM&gt; support &lt;EM&gt;Aggregated (simple)&lt;/EM&gt; and &lt;EM&gt;Aggregated (advanced)&lt;/EM&gt; operators, but not the &lt;EM&gt;Aggregated (periodic)&lt;/EM&gt; operators.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to create aggregated data source&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;In the&amp;nbsp;&lt;STRONG&gt;Data&lt;/STRONG&gt;&amp;nbsp;pane, select a data source.&lt;/LI&gt;
&lt;LI&gt;Click&amp;nbsp;&lt;STRONG&gt;Action&lt;/STRONG&gt;&amp;nbsp;icon&amp;nbsp;and then select&amp;nbsp;&lt;STRONG&gt;New data from aggregation of&amp;nbsp;&lt;EM&gt;data-source&lt;/EM&gt;&lt;/STRONG&gt;. The New Aggregated Data window is displayed.&lt;/LI&gt;
&lt;LI&gt;Select the data items&amp;nbsp;to add to the aggregated data source in the&amp;nbsp;&lt;STRONG&gt;Available items&lt;/STRONG&gt;&amp;nbsp;list.&amp;nbsp;Then, click&amp;nbsp;&lt;STRONG&gt;+&amp;gt;&amp;nbsp;&lt;/STRONG&gt;to move it to the&amp;nbsp;&lt;STRONG&gt;Selected items&lt;/STRONG&gt;&amp;nbsp;list.&lt;/LI&gt;
&lt;LI&gt;(Optional) Change the name of the aggregated data source in the&amp;nbsp;Name&amp;nbsp;field.&lt;/LI&gt;
&lt;LI&gt;Click&amp;nbsp;&lt;STRONG&gt;Ok.&amp;nbsp;&lt;/STRONG&gt;The new aggregated data source is available in the&amp;nbsp;&lt;STRONG&gt;Data&lt;/STRONG&gt;&amp;nbsp;pane.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Now your new data source has &lt;EM&gt;aggregated measures&lt;/EM&gt; of which aggregation you can define normally to be SUM|AVG|MIN|MAX|etc... and also utilize inside &lt;EM&gt;Aggregate Operators&lt;/EM&gt; when creating new calculated items.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may utilize your new measures directly by utilizing the new aggregated data source or by joining the aggregated measures to your original table.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 07:08:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Community-Nordic/Juletip-2-How-to-calculate-AVG-MIN-MAX-etc-for-aggregated/m-p/702987#M311</guid>
      <dc:creator>PetriRoine</dc:creator>
      <dc:date>2020-12-02T07:08:07Z</dc:date>
    </item>
  </channel>
</rss>

