<?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: SAS Visual Analytics Sorting Months that Roll over Years in Line Chart in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/SAS-Visual-Analytics-Sorting-Months-that-Roll-over-Years-in-Line/m-p/803950#M15921</link>
    <description>&lt;P&gt;Finally solved it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;apply this filter:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IF ( Month('date_sel'p) &amp;gt;= 'back_sel'p )&lt;BR /&gt;RETURN ( Month('monyear'n) BetweenInclusive(( Month('date_sel'p)&lt;BR /&gt;- ( 'back_sel'p - 1 ) ), Month('date_sel'p)) )&lt;BR /&gt;ELSE ( ( Month('monyear'n) BetweenInclusive(1, Month('date_sel'p)&lt;BR /&gt;) ) OR ( Month('monyear'n) BetweenInclusive(( 12 - ( (&lt;BR /&gt;'back_sel'p - 1 ) - Month('date_sel'p) ) ), 12) ) )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create custom graph by overlaying line chart and bar char.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Join them on category but not on group.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IF NOT(( Month('monyear'n) BetweenInclusive(( Month('date_sel'p)&lt;BR /&gt;- ( 'back_sel'p - 1 ) ), Month('date_sel'p)) ))&lt;BR /&gt;RETURN Month('monyear'n)&lt;BR /&gt;ELSE ( Month('monyear'n) + 12 )&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pic.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/69764iF91B251DCFCD74E9/image-size/large?v=v2&amp;amp;px=999" role="button" title="pic.png" alt="pic.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Mar 2022 01:16:07 GMT</pubDate>
    <dc:creator>acordes</dc:creator>
    <dc:date>2022-03-25T01:16:07Z</dc:date>
    <item>
      <title>SAS Visual Analytics Sorting Months that Roll over Years in Line Chart</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/SAS-Visual-Analytics-Sorting-Months-that-Roll-over-Years-in-Line/m-p/803811#M15920</link>
      <description>&lt;P&gt;SAS Visual Analytics V. 8.5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset that appends a new monthly snapshot to previous months on the fourth of every month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking at comparing values for a given month with previous years. I converted the date of snapshot variable to months format (numeric 1 - 12) and placed on a line graph grouping by year. For a given month this provides me with my year-over-year comparison. However, I am just looking for the past six months. Current month (March) would roll to previous year. I'm wondering how I would sort months to be in order but roll to the next year. Proper sort would be as follows: (Oct., Nov., Dec., Jan., Feb., Mar.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I looked at custom sorts, but the sorting would change depending on the given month and it isn't as simple as sorting in reverse order by month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The month variable is a date category formatted by month (so numeric values 1 - 12.) Any advice on how to automate sorting to be rolling six months is much appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snapshot of Frequency of source_date Month grouped by source_date Year 03-24-2022 at 10.13.13 AM.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/69750i6F46BB091B2B9DAA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Snapshot of Frequency of source_date Month grouped by source_date Year 03-24-2022 at 10.13.13 AM.png" alt="Snapshot of Frequency of source_date Month grouped by source_date Year 03-24-2022 at 10.13.13 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 15:20:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/SAS-Visual-Analytics-Sorting-Months-that-Roll-over-Years-in-Line/m-p/803811#M15920</guid>
      <dc:creator>juluka</dc:creator>
      <dc:date>2022-03-24T15:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Visual Analytics Sorting Months that Roll over Years in Line Chart</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/SAS-Visual-Analytics-Sorting-Months-that-Roll-over-Years-in-Line/m-p/803950#M15921</link>
      <description>&lt;P&gt;Finally solved it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;apply this filter:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IF ( Month('date_sel'p) &amp;gt;= 'back_sel'p )&lt;BR /&gt;RETURN ( Month('monyear'n) BetweenInclusive(( Month('date_sel'p)&lt;BR /&gt;- ( 'back_sel'p - 1 ) ), Month('date_sel'p)) )&lt;BR /&gt;ELSE ( ( Month('monyear'n) BetweenInclusive(1, Month('date_sel'p)&lt;BR /&gt;) ) OR ( Month('monyear'n) BetweenInclusive(( 12 - ( (&lt;BR /&gt;'back_sel'p - 1 ) - Month('date_sel'p) ) ), 12) ) )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create custom graph by overlaying line chart and bar char.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Join them on category but not on group.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IF NOT(( Month('monyear'n) BetweenInclusive(( Month('date_sel'p)&lt;BR /&gt;- ( 'back_sel'p - 1 ) ), Month('date_sel'p)) ))&lt;BR /&gt;RETURN Month('monyear'n)&lt;BR /&gt;ELSE ( Month('monyear'n) + 12 )&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pic.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/69764iF91B251DCFCD74E9/image-size/large?v=v2&amp;amp;px=999" role="button" title="pic.png" alt="pic.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 01:16:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/SAS-Visual-Analytics-Sorting-Months-that-Roll-over-Years-in-Line/m-p/803950#M15921</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2022-03-25T01:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Visual Analytics Sorting Months that Roll over Years in Line Chart</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/SAS-Visual-Analytics-Sorting-Months-that-Roll-over-Years-in-Line/m-p/804109#M15925</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/127222"&gt;@acordes&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for this response! I spent some time this morning following along and think foundationally I am there. If anyone has any advice on formatting, the only thing I am still struggling with is selecting data tip values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="custom graph.PNG" style="width: 821px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/69810i80C9FCCD27956E28/image-size/large?v=v2&amp;amp;px=999" role="button" title="custom graph.PNG" alt="custom graph.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For anyone following along at home, one additional thing to note. Instead of using our advanced filters, if you were so inclined you can use the calculated numeric item for months and do a ranking to just get the past 'x' months using either hardcoded, controls, or parameters for user input.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One last thing that I tried (and failed to get working) was creating a calculated item using the parallel period operations. I could never get it to return a nonzero / nonempty value. If anyone knows how to use that I would think that would be a simpler solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 15:15:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/SAS-Visual-Analytics-Sorting-Months-that-Roll-over-Years-in-Line/m-p/804109#M15925</guid>
      <dc:creator>juluka</dc:creator>
      <dc:date>2022-03-25T15:15:43Z</dc:date>
    </item>
  </channel>
</rss>

