<?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 Fun with SAS Visual Analytics Graphics: Challenge accepted! in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Fun-with-SAS-Visual-Analytics-Graphics-Challenge-accepted/m-p/405796#M8458</link>
    <description>&lt;P style="margin: 0in 0in 8pt;"&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 8pt;"&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&lt;FONT color="#000000"&gt;A few days ago, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4628"&gt;@tc&lt;/a&gt;, a frequent contributor of the SAS/GRAPH and ODS Graphics Community, shared a &lt;/FONT&gt;&lt;FONT color="#0000ff"&gt;&lt;A href="https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/Fun-w-SAS-ODS-Graphics-There-s-more-than-one-way-to-skin-a-SAS/m-p/401612/highlight/false#M13717" target="_blank"&gt;post&lt;/A&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt; where he used ODS Graphics and PROC SGPANEL to reproduce a chart first created by Robert Allison in his blog, &lt;/FONT&gt;&lt;FONT color="#0000ff"&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2017/10/03/trends-in-u-s-refugee-admissions/" target="_blank"&gt;Trends in U.S. refugee admissions&lt;/A&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT color="#000000"&gt;. At the end of his post,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4628"&gt;@tc&lt;/a&gt; suggested someone try the same chart in SAS Visual Analytics (VA) - I saw it more as a challenge, so challenge accepted. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 8pt;"&gt;&lt;FONT color="#000000" face="verdana,geneva" size="2"&gt;Using VA 8.1, I went to the SAS Visual Data Builder component and imported the source data, an Excel spreadsheet. The data was in a specific worksheet and due to the layout, only a range of cells contained the actual data and the column names spanned across multiple rows, so they could not be imported. &lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 8pt;"&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 8pt;"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Fig.1 – Source spreadsheet" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16087i0EBE0A2454683419/image-size/large?v=v2&amp;amp;px=999" role="button" title="1-Source spreadsheet.png" alt="Fig.1 – Source spreadsheet" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Fig.1 – Source spreadsheet&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000" face="verdana,geneva" size="2"&gt;SAS Visual Data Builder offered all the flexibility needed to import the data in such conditions: I specified the sheet name, the cell range, and choose not to include column names.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in 0in 8pt;"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Fig.2 – Importing the spreadsheet with SAS Visual Data Builder" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16071i3E303AC08DB16CE3/image-size/large?v=v2&amp;amp;px=999" role="button" title="2-Importing the spreadsheet with SAS Visual Data Builder.png" alt="Fig.2 – Importing the spreadsheet with SAS Visual Data Builder" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Fig.2 – Importing the spreadsheet with SAS Visual Data Builder&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;The next step in getting the data ready was to rename the columns and remove column D (a column that contained asterisks in the Excel file). I’ve also removed columns PSI and Total, not used in the final chart. All easily done with SAS Visual Data Builder.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;At that point I had to make a decision: should I transpose the data or not? Well, I ended up saving the table as it was and a second version of the table, I transposed. I’ve decided to do that to show different ways to create the chart. In order to transpose the table, I had to create a new character column that returned a fixed string “Refugees” to be used as the ID column in the transpose.&lt;/FONT&gt;&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-center" image-alt="Fig.3 – Table with ID column in preparation for transposing" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16088iC00118E65107C20F/image-size/large?v=v2&amp;amp;px=999" role="button" title="3- Table with ID column in preparation for transposing.png" alt="Fig.3 – Table with ID column in preparation for transposing" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Fig.3 – Table with ID column in preparation for transposing&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;For the transpose step I’ve selected the new column ID as the ID column, Fiscal Year as the Group By column, and each one of the regions (Africa, Asia, Europe, etc.) as the Transpose columns. The output table is below. I only had to rename _NAME_ to Region and then save the final transposed table.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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-center" image-alt="Fig.4 – Table transposed" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16089i45B475DF5D7C6B34/image-size/large?v=v2&amp;amp;px=999" role="button" title="4- Table transposed.png" alt="Fig.4 – Table transposed" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Fig.4 – Table transposed&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;Now, let’s create the charts!&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&lt;STRONG&gt;Solution #1 – Using transposed table&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;The transposed table allows for a “quick and dirty” chart, meaning that I can leverage the lattice rows role and get the chart done in no time. All I needed to do is use a bar chart with Fiscal Year as the category, Refugees as the Measure, and Region as the lattice row:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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-center" image-alt="Fig.5 – Bar chart roles assignment" style="width: 119px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16090i3954CDE888EDAA5C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="5- Bar chart roles assignment.png" alt="Fig.5 – Bar chart roles assignment" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Fig.5 – Bar chart roles assignment&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000" face="verdana,geneva" size="2"&gt;To make the chart look better, I added a color-mapped display rule for each region. I have not created a display rule for Near East / South Asia because I’ve used the default color for this region. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Fig.6 – Color-mapped display rules for each region" style="width: 188px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16091iF0D3A8B4004B2045/image-size/medium?v=v2&amp;amp;px=400" role="button" title="6- Color-mapped display rules for each region.png" alt="Fig.6 – Color-mapped display rules for each region" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Fig.6 – Color-mapped display rules for each region&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;A title and footnote with a hyperlink to the source Web page (Text objects), smaller font size, sorting by Fiscal Year, and changing other minor axis attributes gave the final touch.&lt;/FONT&gt;&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-center" image-alt="Fig.7 – Final report using transposed table" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16092i42CF2FB3619CC051/image-size/large?v=v2&amp;amp;px=999" role="button" title="7- Final report using transposed table.png" alt="Fig.7 – Final report using transposed table" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Fig.7 – Final report using transposed table&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;Observe that &lt;FONT color="#0000ff"&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2017/10/03/trends-in-u-s-refugee-admissions/" target="_blank"&gt;Allison’s original chart in ODS Graphics&lt;/A&gt;&lt;/FONT&gt; that we are trying to reproduce displayed the regions in a different order. Also, unlike the original chart, all regions from my chart have the same max value in the Y axis. Custom sort, coming in the next SAS Visual Analytics release (8.2) later this year, will allow us to change the order of the regions.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&lt;STRONG&gt;Solution #2 – Using original (non-transposed) table&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;With this type of table, each region is in a different column, so I’ve added one bar chart of each one, where Fiscal Year was assigned to the category role and the corresponding region to the measure. Like in the Solution #1 chart, I’ve added a title and footnote, sorted by Fiscal Year, changed font size and other minor cosmetic attributes, and changed colors by assigning a display rule where the expression tested for the corresponding measure not missing.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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-center" image-alt="Fig.8 – Example of display rule for Asia" style="width: 208px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16098iC820D810FD392AAB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="8- Example of display rule for Asia.png" alt="Fig.8 – Example of display rule for Asia" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Fig.8 – Example of display rule for Asia&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;I’ve also set the Y axis fixed maximum to be the same in all bar charts to keep them consistent and in the same scale, but that caused the bars of some of the regions to almost disappear. This new report allowed me to set individual titles for each region, like in &lt;FONT color="#0000ff"&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2017/10/03/trends-in-u-s-refugee-admissions/" target="_blank"&gt;the original ODS Graphics chart&lt;/A&gt;&lt;/FONT&gt;, but the titles consumed more vertical space so VA automatically removed the tick values from the Y axis.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Fig.9 – Report before working on tick values and bar chart heights" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16094i4307912D53292D2E/image-size/large?v=v2&amp;amp;px=999" role="button" title="9- Report before working on tick values and bar chart heights.png" alt="Fig.9 – Report before working on tick values and bar chart heights" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Fig.9 – Report before working on tick values and bar chart heights&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;To bring the tick values and the little bars back, I’ve used the same technique that &lt;FONT color="#0000ff"&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2017/10/03/trends-in-u-s-refugee-admissions/" target="_blank"&gt;Robert Allison used in the original chart&lt;/A&gt;&lt;/FONT&gt;: set different maximum values in the Y axis but keep the bar chart height proportional with the max value on each bar chart. By doing that I would practically make the bar charts taller, which would cause problems to fit all bar charts vertically on the screen and make it even harder to display the tick values.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;The solution was to use containers: two containers in tile mode (default) inside a container in precision mode. Because part of the content falls outside of the screen, a scroll bar is automatically added to the outer container. Observe that the container sizes were chosen proportionally to keep the individual bar chart heights proportional to each other. Handling situations like that will be a lot simpler in VA 8.2, where you will be able to set the report size and if your computer screen is smaller, scrollbars get added automatically without the need of containers.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Fig.10 – Bar charts inside containers" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16095i96513007DBB17697/image-size/large?v=v2&amp;amp;px=999" role="button" title="10- Bar charts inside containers.png" alt="Fig.10 – Bar charts inside containers" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Fig.10 – Bar charts inside containers&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;This is the final report (two screenshots: before and after scrolling).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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-center" image-alt="11a- Final report using original (non-transposed) table.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16097iF538ADA45761E9A5/image-size/large?v=v2&amp;amp;px=999" role="button" title="11a- Final report using original (non-transposed) table.png" alt="11a- Final report using original (non-transposed) table.png" /&gt;&lt;/span&gt;&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-center" image-alt="Fig.11 – Final report using original (non-transposed) table" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16096i4BF54F24A4A4CE3D/image-size/large?v=v2&amp;amp;px=999" role="button" title="11b- Final report using original (non-transposed) table.png" alt="Fig.11 – Final report using original (non-transposed) table" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Fig.11 – Final report using original (non-transposed) table&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;To wrap up, the report in solution #1 was easier and quicker to create (one bar chart for all regions), but it required a few more steps to transpose the data, which is ok. I didn’t like the tiny bars. Well, VA is interactive, and you can zoom in the chart if needed, so this solution may be good enough. Solution #2 didn’t require the table to be transposed, but I had to create one bar chart for each region and use containers (more objects to manage and more time to design), but the end result was comparable with the original chart. So if this is what you want, the extra work may worth it.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;Overall, it was a nice exercise and showed that all the steps from data access, data transformation, and reporting can be done in SAS Visual Analytics.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;I hope you’ve learned a few tricks.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;Mission accomplished!&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 20 Oct 2017 00:48:03 GMT</pubDate>
    <dc:creator>Renato_sas</dc:creator>
    <dc:date>2017-10-20T00:48:03Z</dc:date>
    <item>
      <title>Fun with SAS Visual Analytics Graphics: Challenge accepted!</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Fun-with-SAS-Visual-Analytics-Graphics-Challenge-accepted/m-p/405796#M8458</link>
      <description>&lt;P style="margin: 0in 0in 8pt;"&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 8pt;"&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&lt;FONT color="#000000"&gt;A few days ago, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4628"&gt;@tc&lt;/a&gt;, a frequent contributor of the SAS/GRAPH and ODS Graphics Community, shared a &lt;/FONT&gt;&lt;FONT color="#0000ff"&gt;&lt;A href="https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/Fun-w-SAS-ODS-Graphics-There-s-more-than-one-way-to-skin-a-SAS/m-p/401612/highlight/false#M13717" target="_blank"&gt;post&lt;/A&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt; where he used ODS Graphics and PROC SGPANEL to reproduce a chart first created by Robert Allison in his blog, &lt;/FONT&gt;&lt;FONT color="#0000ff"&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2017/10/03/trends-in-u-s-refugee-admissions/" target="_blank"&gt;Trends in U.S. refugee admissions&lt;/A&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT color="#000000"&gt;. At the end of his post,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4628"&gt;@tc&lt;/a&gt; suggested someone try the same chart in SAS Visual Analytics (VA) - I saw it more as a challenge, so challenge accepted. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 8pt;"&gt;&lt;FONT color="#000000" face="verdana,geneva" size="2"&gt;Using VA 8.1, I went to the SAS Visual Data Builder component and imported the source data, an Excel spreadsheet. The data was in a specific worksheet and due to the layout, only a range of cells contained the actual data and the column names spanned across multiple rows, so they could not be imported. &lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 8pt;"&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 8pt;"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Fig.1 – Source spreadsheet" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16087i0EBE0A2454683419/image-size/large?v=v2&amp;amp;px=999" role="button" title="1-Source spreadsheet.png" alt="Fig.1 – Source spreadsheet" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Fig.1 – Source spreadsheet&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000" face="verdana,geneva" size="2"&gt;SAS Visual Data Builder offered all the flexibility needed to import the data in such conditions: I specified the sheet name, the cell range, and choose not to include column names.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in 0in 8pt;"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Fig.2 – Importing the spreadsheet with SAS Visual Data Builder" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16071i3E303AC08DB16CE3/image-size/large?v=v2&amp;amp;px=999" role="button" title="2-Importing the spreadsheet with SAS Visual Data Builder.png" alt="Fig.2 – Importing the spreadsheet with SAS Visual Data Builder" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Fig.2 – Importing the spreadsheet with SAS Visual Data Builder&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;The next step in getting the data ready was to rename the columns and remove column D (a column that contained asterisks in the Excel file). I’ve also removed columns PSI and Total, not used in the final chart. All easily done with SAS Visual Data Builder.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;At that point I had to make a decision: should I transpose the data or not? Well, I ended up saving the table as it was and a second version of the table, I transposed. I’ve decided to do that to show different ways to create the chart. In order to transpose the table, I had to create a new character column that returned a fixed string “Refugees” to be used as the ID column in the transpose.&lt;/FONT&gt;&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-center" image-alt="Fig.3 – Table with ID column in preparation for transposing" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16088iC00118E65107C20F/image-size/large?v=v2&amp;amp;px=999" role="button" title="3- Table with ID column in preparation for transposing.png" alt="Fig.3 – Table with ID column in preparation for transposing" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Fig.3 – Table with ID column in preparation for transposing&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;For the transpose step I’ve selected the new column ID as the ID column, Fiscal Year as the Group By column, and each one of the regions (Africa, Asia, Europe, etc.) as the Transpose columns. The output table is below. I only had to rename _NAME_ to Region and then save the final transposed table.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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-center" image-alt="Fig.4 – Table transposed" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16089i45B475DF5D7C6B34/image-size/large?v=v2&amp;amp;px=999" role="button" title="4- Table transposed.png" alt="Fig.4 – Table transposed" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Fig.4 – Table transposed&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;Now, let’s create the charts!&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&lt;STRONG&gt;Solution #1 – Using transposed table&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;The transposed table allows for a “quick and dirty” chart, meaning that I can leverage the lattice rows role and get the chart done in no time. All I needed to do is use a bar chart with Fiscal Year as the category, Refugees as the Measure, and Region as the lattice row:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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-center" image-alt="Fig.5 – Bar chart roles assignment" style="width: 119px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16090i3954CDE888EDAA5C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="5- Bar chart roles assignment.png" alt="Fig.5 – Bar chart roles assignment" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Fig.5 – Bar chart roles assignment&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000" face="verdana,geneva" size="2"&gt;To make the chart look better, I added a color-mapped display rule for each region. I have not created a display rule for Near East / South Asia because I’ve used the default color for this region. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Fig.6 – Color-mapped display rules for each region" style="width: 188px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16091iF0D3A8B4004B2045/image-size/medium?v=v2&amp;amp;px=400" role="button" title="6- Color-mapped display rules for each region.png" alt="Fig.6 – Color-mapped display rules for each region" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Fig.6 – Color-mapped display rules for each region&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;A title and footnote with a hyperlink to the source Web page (Text objects), smaller font size, sorting by Fiscal Year, and changing other minor axis attributes gave the final touch.&lt;/FONT&gt;&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-center" image-alt="Fig.7 – Final report using transposed table" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16092i42CF2FB3619CC051/image-size/large?v=v2&amp;amp;px=999" role="button" title="7- Final report using transposed table.png" alt="Fig.7 – Final report using transposed table" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Fig.7 – Final report using transposed table&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;Observe that &lt;FONT color="#0000ff"&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2017/10/03/trends-in-u-s-refugee-admissions/" target="_blank"&gt;Allison’s original chart in ODS Graphics&lt;/A&gt;&lt;/FONT&gt; that we are trying to reproduce displayed the regions in a different order. Also, unlike the original chart, all regions from my chart have the same max value in the Y axis. Custom sort, coming in the next SAS Visual Analytics release (8.2) later this year, will allow us to change the order of the regions.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&lt;STRONG&gt;Solution #2 – Using original (non-transposed) table&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;With this type of table, each region is in a different column, so I’ve added one bar chart of each one, where Fiscal Year was assigned to the category role and the corresponding region to the measure. Like in the Solution #1 chart, I’ve added a title and footnote, sorted by Fiscal Year, changed font size and other minor cosmetic attributes, and changed colors by assigning a display rule where the expression tested for the corresponding measure not missing.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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-center" image-alt="Fig.8 – Example of display rule for Asia" style="width: 208px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16098iC820D810FD392AAB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="8- Example of display rule for Asia.png" alt="Fig.8 – Example of display rule for Asia" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Fig.8 – Example of display rule for Asia&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;I’ve also set the Y axis fixed maximum to be the same in all bar charts to keep them consistent and in the same scale, but that caused the bars of some of the regions to almost disappear. This new report allowed me to set individual titles for each region, like in &lt;FONT color="#0000ff"&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2017/10/03/trends-in-u-s-refugee-admissions/" target="_blank"&gt;the original ODS Graphics chart&lt;/A&gt;&lt;/FONT&gt;, but the titles consumed more vertical space so VA automatically removed the tick values from the Y axis.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Fig.9 – Report before working on tick values and bar chart heights" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16094i4307912D53292D2E/image-size/large?v=v2&amp;amp;px=999" role="button" title="9- Report before working on tick values and bar chart heights.png" alt="Fig.9 – Report before working on tick values and bar chart heights" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Fig.9 – Report before working on tick values and bar chart heights&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;To bring the tick values and the little bars back, I’ve used the same technique that &lt;FONT color="#0000ff"&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2017/10/03/trends-in-u-s-refugee-admissions/" target="_blank"&gt;Robert Allison used in the original chart&lt;/A&gt;&lt;/FONT&gt;: set different maximum values in the Y axis but keep the bar chart height proportional with the max value on each bar chart. By doing that I would practically make the bar charts taller, which would cause problems to fit all bar charts vertically on the screen and make it even harder to display the tick values.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;The solution was to use containers: two containers in tile mode (default) inside a container in precision mode. Because part of the content falls outside of the screen, a scroll bar is automatically added to the outer container. Observe that the container sizes were chosen proportionally to keep the individual bar chart heights proportional to each other. Handling situations like that will be a lot simpler in VA 8.2, where you will be able to set the report size and if your computer screen is smaller, scrollbars get added automatically without the need of containers.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Fig.10 – Bar charts inside containers" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16095i96513007DBB17697/image-size/large?v=v2&amp;amp;px=999" role="button" title="10- Bar charts inside containers.png" alt="Fig.10 – Bar charts inside containers" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Fig.10 – Bar charts inside containers&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;This is the final report (two screenshots: before and after scrolling).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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-center" image-alt="11a- Final report using original (non-transposed) table.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16097iF538ADA45761E9A5/image-size/large?v=v2&amp;amp;px=999" role="button" title="11a- Final report using original (non-transposed) table.png" alt="11a- Final report using original (non-transposed) table.png" /&gt;&lt;/span&gt;&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-center" image-alt="Fig.11 – Final report using original (non-transposed) table" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16096i4BF54F24A4A4CE3D/image-size/large?v=v2&amp;amp;px=999" role="button" title="11b- Final report using original (non-transposed) table.png" alt="Fig.11 – Final report using original (non-transposed) table" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Fig.11 – Final report using original (non-transposed) table&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;To wrap up, the report in solution #1 was easier and quicker to create (one bar chart for all regions), but it required a few more steps to transpose the data, which is ok. I didn’t like the tiny bars. Well, VA is interactive, and you can zoom in the chart if needed, so this solution may be good enough. Solution #2 didn’t require the table to be transposed, but I had to create one bar chart for each region and use containers (more objects to manage and more time to design), but the end result was comparable with the original chart. So if this is what you want, the extra work may worth it.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;Overall, it was a nice exercise and showed that all the steps from data access, data transformation, and reporting can be done in SAS Visual Analytics.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;I hope you’ve learned a few tricks.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;Mission accomplished!&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2017 00:48:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Fun-with-SAS-Visual-Analytics-Graphics-Challenge-accepted/m-p/405796#M8458</guid>
      <dc:creator>Renato_sas</dc:creator>
      <dc:date>2017-10-20T00:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: Fun with SAS Visual Analytics Graphics: one view of the general problem</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Fun-with-SAS-Visual-Analytics-Graphics-Challenge-accepted/m-p/426889#M9118</link>
      <description>&lt;P&gt;This seems like a good start.&amp;nbsp;&amp;nbsp;I look forward to your updating the solution as it could use 8.2 ( not 8.1 ).&amp;nbsp; I had planed to restructure my data so that I could generate one set of lattice plots for each of the filtered subsets.&amp;nbsp; But I have just&amp;nbsp;not gotten this to work properly (&amp;nbsp;at least yet ).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's one way to describe the problem:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, I&amp;nbsp;think William Cleveland would&amp;nbsp;say that you don't want to try to put too many points on individual plots, and instead use systems of&amp;nbsp;lattice plots ( "trellis plots"&amp;nbsp; )&amp;nbsp;and other kinds of graphic techniques. &amp;nbsp;These techniques are apt to be&amp;nbsp;used&amp;nbsp;together with filtering and&amp;nbsp;dimensionality reduction on the back end where now one would be apt to make effective use of server clusters to do that work.&amp;nbsp;&amp;nbsp; Having said that, it's not clear that all the pieces are in place&amp;nbsp;for SAS Studio / SAS VA&amp;nbsp;this at this point to take this approach in general.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My guess is that a general solution would be to&amp;nbsp;be use SAS VA to call&amp;nbsp; macros written in SAS Studio from&amp;nbsp;SAS.&amp;nbsp;&amp;nbsp;The macros written in SAS Studio&amp;nbsp;would&amp;nbsp;do some additional filtering,&amp;nbsp;sampling/ stratified sampling), or&amp;nbsp;dimensionality reduction in other ways.&amp;nbsp;&amp;nbsp;But I don't see how to do that now,&amp;nbsp;that is use SAS DS2 code to create data subsets on the fly that&amp;nbsp;can then plotted in SAS VA.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So at this point I still plan to do&amp;nbsp;this in SAS Studio, using SGPANEL/SGPLOT functions wrapped by&amp;nbsp; macros.&amp;nbsp;&amp;nbsp;Using this&amp;nbsp;kind of approach&amp;nbsp;would essentially give you the "R"&amp;nbsp;approach to programming things using&amp;nbsp;the "lattice"&amp;nbsp;and "ggplot2" packages of R.&amp;nbsp; And, that would be&amp;nbsp;okay.&amp;nbsp;&amp;nbsp;&amp;nbsp;But I think a more general solution making&amp;nbsp;greater use&amp;nbsp;of SAS VA would be more helpful.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But if you could continue to evolve your current approach, a document it using SAS VA 8.2, perhaps that gives another way to make use of SAS VA rather than SAS Studio.&amp;nbsp; So if you can continue to document your own approach so far, that would be quite good.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, rh&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;&lt;P&gt;&amp;nbsp;&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 15:17:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Fun-with-SAS-Visual-Analytics-Graphics-Challenge-accepted/m-p/426889#M9118</guid>
      <dc:creator>RichHaney</dc:creator>
      <dc:date>2018-01-11T15:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: Fun with SAS Visual Analytics Graphics: one view of the general problem</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Fun-with-SAS-Visual-Analytics-Graphics-Challenge-accepted/m-p/427260#M9125</link>
      <description>&lt;P&gt;&lt;SPAN style="margin: 0px; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;&lt;FONT color="#000000"&gt;Thanks for your comment, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/186123"&gt;@RichHaney&lt;/a&gt;. You raise some good ideas on ways to iterate this example. I’ll take a look at new possibilities to deliver the bar charts in VA 8.2, like using the Data-Driven Content object for example.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 16:39:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Fun-with-SAS-Visual-Analytics-Graphics-Challenge-accepted/m-p/427260#M9125</guid>
      <dc:creator>Renato_sas</dc:creator>
      <dc:date>2018-01-12T16:39:56Z</dc:date>
    </item>
  </channel>
</rss>

