<?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: Calculating Month and Fiscal Averages in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Calculating-Month-and-Fiscal-Averages/m-p/709487#M14552</link>
    <description>&lt;P&gt;Asssuming your date variable is in a date format, you can do the following:&lt;/P&gt;
&lt;P&gt;(If your date is a character, you can create a calculated item and use the parse operator to convert the date to a date type)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Average by Month:&lt;/P&gt;
&lt;P&gt;1. Duplicate the date variable, rename to Month Year, and change the format to 'MMMYYYY'&lt;/P&gt;
&lt;P&gt;2. Create a calculated item 'Average Population' = Avg [by group] population'&lt;/P&gt;
&lt;P&gt;3. Put the Month Year and Average Population in a list table and averages by month will be calculated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Average by Fiscal Year:&lt;/P&gt;
&lt;P&gt;I would recommend adding an extra column in your data indicating which fiscal period that date falls within. For example, if one fiscal year is April 2014 - March 2015, then add an extra column where the fiscal year is 2014 for all those records. Your data should look something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="277px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="95px" height="57px"&gt;date&lt;/TD&gt;
&lt;TD width="85px" height="57px"&gt;population&lt;/TD&gt;
&lt;TD width="61px" height="57px"&gt;gender&lt;/TD&gt;
&lt;TD width="48px" height="57px"&gt;fiscal year&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="95px" height="30px"&gt;04Jan2015&lt;/TD&gt;
&lt;TD width="85px" height="30px"&gt;395&lt;/TD&gt;
&lt;TD width="61px" height="30px"&gt;F&lt;/TD&gt;
&lt;TD width="48px" height="30px"&gt;2014&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="95px" height="30px"&gt;04Jan2015&lt;/TD&gt;
&lt;TD width="85px" height="30px"&gt;3052&lt;/TD&gt;
&lt;TD width="61px" height="30px"&gt;M&lt;/TD&gt;
&lt;TD width="48px" height="30px"&gt;2014&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="95px" height="30px"&gt;05Apr2015&lt;/TD&gt;
&lt;TD width="85px" height="30px"&gt;3143&lt;/TD&gt;
&lt;TD width="61px" height="30px"&gt;M&lt;/TD&gt;
&lt;TD width="48px" height="30px"&gt;2015&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="95px" height="30px"&gt;05May2015&lt;/TD&gt;
&lt;TD width="85px" height="30px"&gt;397&lt;/TD&gt;
&lt;TD width="61px" height="30px"&gt;F&lt;/TD&gt;
&lt;TD width="48px" height="30px"&gt;2015&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="95px" height="30px"&gt;06Jan2016&lt;/TD&gt;
&lt;TD width="85px" height="30px"&gt;405&lt;/TD&gt;
&lt;TD width="61px" height="30px"&gt;F&lt;/TD&gt;
&lt;TD width="48px" height="30px"&gt;2015&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="95px" height="30px"&gt;06May2016&lt;/TD&gt;
&lt;TD width="85px" height="30px"&gt;3120&lt;/TD&gt;
&lt;TD width="61px" height="30px"&gt;M&lt;/TD&gt;
&lt;TD width="48px" height="30px"&gt;2016&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, you can use the fiscal year variable and the same average population item created above in another list table and the averages will automatically calculate for the fiscal years.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Jaime&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jan 2021 19:42:00 GMT</pubDate>
    <dc:creator>jaseit</dc:creator>
    <dc:date>2021-01-05T19:42:00Z</dc:date>
    <item>
      <title>Calculating Month and Fiscal Averages</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Calculating-Month-and-Fiscal-Averages/m-p/706479#M14517</link>
      <description>&lt;P&gt;Have the following in SAS VA *8.3 I believe*:&lt;/P&gt;
&lt;TABLE width="204"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="75"&gt;date&lt;/TD&gt;
&lt;TD width="76"&gt;population&lt;/TD&gt;
&lt;TD width="53"&gt;gender&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;04Jan2015&lt;/TD&gt;
&lt;TD&gt;395&lt;/TD&gt;
&lt;TD&gt;F&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;04Jan2015&lt;/TD&gt;
&lt;TD&gt;3052&lt;/TD&gt;
&lt;TD&gt;M&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;05Jan2015&lt;/TD&gt;
&lt;TD&gt;3143&lt;/TD&gt;
&lt;TD&gt;M&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;05Jan2015&lt;/TD&gt;
&lt;TD&gt;397&lt;/TD&gt;
&lt;TD&gt;F&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;06Jan2015&lt;/TD&gt;
&lt;TD&gt;405&lt;/TD&gt;
&lt;TD&gt;F&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;06Jan2015&lt;/TD&gt;
&lt;TD&gt;3120&lt;/TD&gt;
&lt;TD&gt;M&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;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t;
&lt;TD&gt;F&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;Want:&lt;/P&gt;
&lt;P&gt;a) average population per month&lt;/P&gt;
&lt;P&gt;b) average population per fiscal year (April 01-March 31)&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 22:57:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Calculating-Month-and-Fiscal-Averages/m-p/706479#M14517</guid>
      <dc:creator>ChristyN</dc:creator>
      <dc:date>2020-12-16T22:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Month and Fiscal Averages</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Calculating-Month-and-Fiscal-Averages/m-p/707393#M14529</link>
      <description>&lt;P&gt;Could you please confirm the &lt;STRONG&gt;date&lt;/STRONG&gt; variable in your example data is correct? It's now all January 2015. Could you please also explain what you have tried? List Table, Crosstab, bar chart,...?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Petri&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS. You can check the exact version number from top right corner: click&amp;nbsp;the User icon &amp;gt; About.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2020 10:02:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Calculating-Month-and-Fiscal-Averages/m-p/707393#M14529</guid>
      <dc:creator>PetriRoine</dc:creator>
      <dc:date>2020-12-21T10:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Month and Fiscal Averages</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Calculating-Month-and-Fiscal-Averages/m-p/709487#M14552</link>
      <description>&lt;P&gt;Asssuming your date variable is in a date format, you can do the following:&lt;/P&gt;
&lt;P&gt;(If your date is a character, you can create a calculated item and use the parse operator to convert the date to a date type)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Average by Month:&lt;/P&gt;
&lt;P&gt;1. Duplicate the date variable, rename to Month Year, and change the format to 'MMMYYYY'&lt;/P&gt;
&lt;P&gt;2. Create a calculated item 'Average Population' = Avg [by group] population'&lt;/P&gt;
&lt;P&gt;3. Put the Month Year and Average Population in a list table and averages by month will be calculated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Average by Fiscal Year:&lt;/P&gt;
&lt;P&gt;I would recommend adding an extra column in your data indicating which fiscal period that date falls within. For example, if one fiscal year is April 2014 - March 2015, then add an extra column where the fiscal year is 2014 for all those records. Your data should look something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="277px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="95px" height="57px"&gt;date&lt;/TD&gt;
&lt;TD width="85px" height="57px"&gt;population&lt;/TD&gt;
&lt;TD width="61px" height="57px"&gt;gender&lt;/TD&gt;
&lt;TD width="48px" height="57px"&gt;fiscal year&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="95px" height="30px"&gt;04Jan2015&lt;/TD&gt;
&lt;TD width="85px" height="30px"&gt;395&lt;/TD&gt;
&lt;TD width="61px" height="30px"&gt;F&lt;/TD&gt;
&lt;TD width="48px" height="30px"&gt;2014&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="95px" height="30px"&gt;04Jan2015&lt;/TD&gt;
&lt;TD width="85px" height="30px"&gt;3052&lt;/TD&gt;
&lt;TD width="61px" height="30px"&gt;M&lt;/TD&gt;
&lt;TD width="48px" height="30px"&gt;2014&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="95px" height="30px"&gt;05Apr2015&lt;/TD&gt;
&lt;TD width="85px" height="30px"&gt;3143&lt;/TD&gt;
&lt;TD width="61px" height="30px"&gt;M&lt;/TD&gt;
&lt;TD width="48px" height="30px"&gt;2015&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="95px" height="30px"&gt;05May2015&lt;/TD&gt;
&lt;TD width="85px" height="30px"&gt;397&lt;/TD&gt;
&lt;TD width="61px" height="30px"&gt;F&lt;/TD&gt;
&lt;TD width="48px" height="30px"&gt;2015&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="95px" height="30px"&gt;06Jan2016&lt;/TD&gt;
&lt;TD width="85px" height="30px"&gt;405&lt;/TD&gt;
&lt;TD width="61px" height="30px"&gt;F&lt;/TD&gt;
&lt;TD width="48px" height="30px"&gt;2015&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="95px" height="30px"&gt;06May2016&lt;/TD&gt;
&lt;TD width="85px" height="30px"&gt;3120&lt;/TD&gt;
&lt;TD width="61px" height="30px"&gt;M&lt;/TD&gt;
&lt;TD width="48px" height="30px"&gt;2016&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, you can use the fiscal year variable and the same average population item created above in another list table and the averages will automatically calculate for the fiscal years.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Jaime&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 19:42:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Calculating-Month-and-Fiscal-Averages/m-p/709487#M14552</guid>
      <dc:creator>jaseit</dc:creator>
      <dc:date>2021-01-05T19:42:00Z</dc:date>
    </item>
  </channel>
</rss>

