<?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: Filter between measures on graph in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Filter-between-measures-on-graph/m-p/791122#M15754</link>
    <description>&lt;P&gt;I suppose you're referring to Visual Analytics.&lt;/P&gt;
&lt;P&gt;In case that's true yes you can do it by using a dummy table for creating a customized category, attach a parameter to it and use it in new data item within an if-then-statement. return the variable you want the user to select between. use this dynamic data item as role (for example x) in the graph.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/61362"&gt;@Stu_SAS&lt;/a&gt;&amp;nbsp;wrote a paper about it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/2986-2019.pdf" target="_blank" rel="noopener"&gt;Mastering Parameters in SAS Visual Analytics&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;page 5-6&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jan 2022 11:44:05 GMT</pubDate>
    <dc:creator>acordes</dc:creator>
    <dc:date>2022-01-20T11:44:05Z</dc:date>
    <item>
      <title>Filter between measures on graph</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Filter-between-measures-on-graph/m-p/791110#M15753</link>
      <description>&lt;P&gt;Hi SAS Community&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to create a filter on a line graph to change the measure that is used in the graph?&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example: I want the user to change the measure in the graph from Sales Rand to Sales Quantity.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 10:43:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Filter-between-measures-on-graph/m-p/791110#M15753</guid>
      <dc:creator>Melissak</dc:creator>
      <dc:date>2022-01-20T10:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: Filter between measures on graph</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Filter-between-measures-on-graph/m-p/791122#M15754</link>
      <description>&lt;P&gt;I suppose you're referring to Visual Analytics.&lt;/P&gt;
&lt;P&gt;In case that's true yes you can do it by using a dummy table for creating a customized category, attach a parameter to it and use it in new data item within an if-then-statement. return the variable you want the user to select between. use this dynamic data item as role (for example x) in the graph.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/61362"&gt;@Stu_SAS&lt;/a&gt;&amp;nbsp;wrote a paper about it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/2986-2019.pdf" target="_blank" rel="noopener"&gt;Mastering Parameters in SAS Visual Analytics&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;page 5-6&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 11:44:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Filter-between-measures-on-graph/m-p/791122#M15754</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2022-01-20T11:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: Filter between measures on graph</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Filter-between-measures-on-graph/m-p/791170#M15755</link>
      <description>&lt;P&gt;Thanks, Arne! You are exactly right, a parameter is an effective way to do this. Here are two possible options:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;1. Using Parameters&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;STRONG&gt;Works on:&lt;/STRONG&gt; All versions of Visual Analytics&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;As Arne hinted, parameters are a very powerful concept and allow you to create things like dynamic variables that let you switch between one or more variables:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="parameter.gif" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67549i1FFF1138F125FA6C/image-size/large?v=v2&amp;amp;px=999" role="button" title="parameter.gif" alt="parameter.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;To create a dynamic variable with a parameter:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Create a new Character parameter&lt;/LI&gt;
&lt;LI&gt;Create a new calculated variable and add the following code:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if(upcase('Parameter 1'p) = 'LABEL HERE') return 'Var 1'n
    else 'Var 2'n&lt;/CODE&gt;&lt;/PRE&gt;
Where &lt;FONT color="#333399"&gt;'LABEL HERE'&lt;/FONT&gt; refers to the value of the button the user selected, and &lt;FONT color="#333399"&gt;'Var 1'n/'Var 2'n&lt;/FONT&gt; refer to your variables you'd like to switch between. In the image shown above, the labels are "MPG (City)" and "MPG (Highway)."&lt;/LI&gt;
&lt;LI&gt;Add the new calculated variable to your graph&lt;/LI&gt;
&lt;LI&gt;Add a new button bar populated with the label names you would like to use. In the paper Arne linked, p. 6-7 shows one way to achieve this; however, you can create the same labels using your existing dataset. You'll need to be careful so that they do not get filtered out by report-level or page-level filters.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;When users select buttons, the variable in the graph will automatically change. The downside of this is that the variable being shown has a static name. You'll want to add the parameter to dynamic text so that users are aware of what they are looking at.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;2. Viewer Data Edits&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Works on:&amp;nbsp;&lt;/STRONG&gt;VA 8.4+&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you change the Viewer Customization level for the report to "Data Edits" under the Report Options pane, report viewers can modify graphs to display which variables they would like to see:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Stu_SAS_2-1642690152663.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67546i0E051A6050274C9D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Stu_SAS_2-1642690152663.png" alt="Stu_SAS_2-1642690152663.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dataedits.gif" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67548i1956CE13422B132C/image-size/large?v=v2&amp;amp;px=999" role="button" title="dataedits.gif" alt="dataedits.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;This way the user can create their own analysis with the variables you leave unhidden.&lt;BR /&gt;&lt;BR /&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 18:59:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Filter-between-measures-on-graph/m-p/791170#M15755</guid>
      <dc:creator>Stu_SAS</dc:creator>
      <dc:date>2022-01-20T18:59:42Z</dc:date>
    </item>
  </channel>
</rss>

