<?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: Difference between the overall % of a population and the filtered % in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Difference-between-the-overall-of-a-population-and-the-filtered/m-p/748053#M15013</link>
    <description>&lt;P&gt;Hi Gary&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/99545"&gt;@ghartge&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The assignment worked for me by creating a character parameter that is populated by a drop down list and a calculated measure item that has the measure for only your subgroup.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My dataset contains sales data of a retail chain. It has the variables Shop Province and Customer Province and a measure named Total Sales.&lt;/P&gt;&lt;P&gt;If I want to imitate your case I want to see the difference in Total sales by Shop Province overall and per selected Customer province.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 1: Create a Total Sales Customer Province Parameter that is Classified as category and has no default value (or any default value you choose) and allows only 1 value.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JustinCase_0-1623741394654.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60392i4484037A6905BF23/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JustinCase_0-1623741394654.png" alt="JustinCase_0-1623741394654.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 2: Insert a drop downlist onto your canvas and add Customer Province to the Category role and the parameter of step 1 to the Parameter role.&lt;/P&gt;&lt;P&gt;Step 3: Create the measure for your selection:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;IF ( 'Customer Province'n = 'Total Sales Customer Province'p )&lt;BR /&gt;RETURN 'Total Sales'n&lt;BR /&gt;ELSE 0&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;And name it Total Sales selection&lt;/P&gt;&lt;P&gt;Step 4: Create aggregated measures Total Sales (%) and Total Sales selection (%) by right clicking on Total Sales and then choose New calculation. Choose Percent of Total - Sum&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JustinCase_2-1623741849167.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60396iEF4B0E78E2F10748/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JustinCase_2-1623741849167.png" alt="JustinCase_2-1623741849167.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 5: Create an aggregated measure&amp;nbsp;Difference in Total sales percentage with expression&lt;/P&gt;&lt;P&gt;'Total Sales (%)'n - 'Total Sales selection (%)'n&lt;/P&gt;&lt;P&gt;Step 6: Drag a list table onto your canvas and add the variables Shop Province, Total Sales (%), Total Sales selection (%) and&amp;nbsp;Difference in Total sales percentage. My result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JustinCase_3-1623742148810.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60397iD95C75525DDFB0A9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JustinCase_3-1623742148810.png" alt="JustinCase_3-1623742148810.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;If you choose Ethnicity in stead of Shop Province and Population in stead of Total Sales and your selection variable in stead of Customer Province then you are there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kees Kramer&lt;/P&gt;</description>
    <pubDate>Tue, 15 Jun 2021 07:32:36 GMT</pubDate>
    <dc:creator>JustinCase</dc:creator>
    <dc:date>2021-06-15T07:32:36Z</dc:date>
    <item>
      <title>Difference between the overall % of a population and the filtered %</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Difference-between-the-overall-of-a-population-and-the-filtered/m-p/746319#M14996</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been asked to produce a SAS VA 7.5 report that will give the user the following;&lt;/P&gt;&lt;P&gt;The overall population of a group broken down by race/ethnicity&lt;/P&gt;&lt;P&gt;The percentage breakdown by race/ethnicity of the same group filtered for any number of dropdown boxes, as subset of the first group.&lt;/P&gt;&lt;P&gt;The difference between those values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Ethnicity&lt;/TD&gt;&lt;TD&gt;Overall Population&lt;/TD&gt;&lt;TD&gt;Filtered Overall population&lt;/TD&gt;&lt;TD&gt;Difference&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 1&lt;/TD&gt;&lt;TD&gt;21.0%&lt;/TD&gt;&lt;TD&gt;23.50%&lt;/TD&gt;&lt;TD&gt;-2.5%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 2&lt;/TD&gt;&lt;TD&gt;14.3%&lt;/TD&gt;&lt;TD&gt;14.60%&lt;/TD&gt;&lt;TD&gt;-0.3%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 3&lt;/TD&gt;&lt;TD&gt;4.4%&lt;/TD&gt;&lt;TD&gt;4.70%&lt;/TD&gt;&lt;TD&gt;-0.3%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 4&lt;/TD&gt;&lt;TD&gt;54.0%&lt;/TD&gt;&lt;TD&gt;51.80%&lt;/TD&gt;&lt;TD&gt;2.2%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 5&lt;/TD&gt;&lt;TD&gt;6.3%&lt;/TD&gt;&lt;TD&gt;5.40%&lt;/TD&gt;&lt;TD&gt;0.9%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can create crosstabs, lists, tables, etc. that contain each of these breakdowns, but am at a loss as to how to calculate the difference between the two.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought about using parameters on a table or other object, but that only given me the character values, not the percentages, or that method isn't possible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for any help. I cannot address it in my SAS EG programming since the combination of filters that can be used is huge.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gary&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jun 2021 17:12:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Difference-between-the-overall-of-a-population-and-the-filtered/m-p/746319#M14996</guid>
      <dc:creator>ghartge</dc:creator>
      <dc:date>2021-06-07T17:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between the overall % of a population and the filtered %</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Difference-between-the-overall-of-a-population-and-the-filtered/m-p/748053#M15013</link>
      <description>&lt;P&gt;Hi Gary&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/99545"&gt;@ghartge&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The assignment worked for me by creating a character parameter that is populated by a drop down list and a calculated measure item that has the measure for only your subgroup.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My dataset contains sales data of a retail chain. It has the variables Shop Province and Customer Province and a measure named Total Sales.&lt;/P&gt;&lt;P&gt;If I want to imitate your case I want to see the difference in Total sales by Shop Province overall and per selected Customer province.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 1: Create a Total Sales Customer Province Parameter that is Classified as category and has no default value (or any default value you choose) and allows only 1 value.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JustinCase_0-1623741394654.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60392i4484037A6905BF23/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JustinCase_0-1623741394654.png" alt="JustinCase_0-1623741394654.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 2: Insert a drop downlist onto your canvas and add Customer Province to the Category role and the parameter of step 1 to the Parameter role.&lt;/P&gt;&lt;P&gt;Step 3: Create the measure for your selection:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;IF ( 'Customer Province'n = 'Total Sales Customer Province'p )&lt;BR /&gt;RETURN 'Total Sales'n&lt;BR /&gt;ELSE 0&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;And name it Total Sales selection&lt;/P&gt;&lt;P&gt;Step 4: Create aggregated measures Total Sales (%) and Total Sales selection (%) by right clicking on Total Sales and then choose New calculation. Choose Percent of Total - Sum&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JustinCase_2-1623741849167.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60396iEF4B0E78E2F10748/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JustinCase_2-1623741849167.png" alt="JustinCase_2-1623741849167.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 5: Create an aggregated measure&amp;nbsp;Difference in Total sales percentage with expression&lt;/P&gt;&lt;P&gt;'Total Sales (%)'n - 'Total Sales selection (%)'n&lt;/P&gt;&lt;P&gt;Step 6: Drag a list table onto your canvas and add the variables Shop Province, Total Sales (%), Total Sales selection (%) and&amp;nbsp;Difference in Total sales percentage. My result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JustinCase_3-1623742148810.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60397iD95C75525DDFB0A9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JustinCase_3-1623742148810.png" alt="JustinCase_3-1623742148810.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;If you choose Ethnicity in stead of Shop Province and Population in stead of Total Sales and your selection variable in stead of Customer Province then you are there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kees Kramer&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 07:32:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Difference-between-the-overall-of-a-population-and-the-filtered/m-p/748053#M15013</guid>
      <dc:creator>JustinCase</dc:creator>
      <dc:date>2021-06-15T07:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between the overall % of a population and the filtered %</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Difference-between-the-overall-of-a-population-and-the-filtered/m-p/749266#M15041</link>
      <description>&lt;P&gt;Thank you Kees! I will see if I can use your approach. Looks pretty straight forward.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 14:37:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Difference-between-the-overall-of-a-population-and-the-filtered/m-p/749266#M15041</guid>
      <dc:creator>ghartge</dc:creator>
      <dc:date>2021-06-21T14:37:17Z</dc:date>
    </item>
  </channel>
</rss>

