<?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 how to calculate total groub by column and percent in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/how-to-calculate-total-groub-by-column-and-percent/m-p/919528#M17901</link>
    <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am attempting to create the same report in SAS. Could you assist me in calculating the total and percentage for each equipment, as illustrated in the image? I've tried in SAS, but the result doesn't appear to be accurate. I aim for the subtotal to be 100%.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sara93_1-1709924127276.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/94500i470C406EB310636B/image-dimensions/600x27?v=v2" width="600" height="27" role="button" title="sara93_1-1709924127276.png" alt="sara93_1-1709924127276.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sara93_2-1709924841830.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/94503iDAD912105657D788/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sara93_2-1709924841830.png" alt="sara93_2-1709924841830.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Mar 2024 19:07:39 GMT</pubDate>
    <dc:creator>sara93</dc:creator>
    <dc:date>2024-03-08T19:07:39Z</dc:date>
    <item>
      <title>how to calculate total groub by column and percent</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/how-to-calculate-total-groub-by-column-and-percent/m-p/919528#M17901</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am attempting to create the same report in SAS. Could you assist me in calculating the total and percentage for each equipment, as illustrated in the image? I've tried in SAS, but the result doesn't appear to be accurate. I aim for the subtotal to be 100%.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sara93_1-1709924127276.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/94500i470C406EB310636B/image-dimensions/600x27?v=v2" width="600" height="27" role="button" title="sara93_1-1709924127276.png" alt="sara93_1-1709924127276.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sara93_2-1709924841830.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/94503iDAD912105657D788/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sara93_2-1709924841830.png" alt="sara93_2-1709924841830.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2024 19:07:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/how-to-calculate-total-groub-by-column-and-percent/m-p/919528#M17901</guid>
      <dc:creator>sara93</dc:creator>
      <dc:date>2024-03-08T19:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate total groub by column and percent</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/how-to-calculate-total-groub-by-column-and-percent/m-p/919541#M17902</link>
      <description>Hi, What procedure are you using? What code have you tried. Your very wide screen shot it too small to read and too blurry when zoomed. Without data or some idea of the structure of your input data, and some idea of the code you're using and the type of output you need, no one is really able to make constructive suggestions. My instinct is to suggest PROC TABULATE, however, without seeing the structure of the data, I'm not sure that it is the correct instinct.&lt;BR /&gt;Cynthia</description>
      <pubDate>Fri, 08 Mar 2024 19:36:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/how-to-calculate-total-groub-by-column-and-percent/m-p/919541#M17902</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2024-03-08T19:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate total groub by column and percent</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/how-to-calculate-total-groub-by-column-and-percent/m-p/919548#M17903</link>
      <description>&lt;P&gt;thank you for your respond,&lt;/P&gt;&lt;P&gt;im using a cross tab&amp;nbsp; with hierarchy column (epuipement + brand) and parc actif is my measure .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sara93_0-1709927054823.png" style="width: 813px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/94512iD61297F8E250BA25/image-dimensions/813x122?v=v2" width="813" height="122" role="button" title="sara93_0-1709927054823.png" alt="sara93_0-1709927054823.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have calculated Pourcentage by following these steps :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sara93_1-1709927329310.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/94513i3B38912CDC717FF2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sara93_1-1709927329310.png" alt="sara93_1-1709927329310.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and adding subtotal to my crosstab.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is there any way to calculate the total of percent of the subtotal similar to the following crosstab&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sara93_2-1709927524693.png" style="width: 732px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/94514iBD0455B70949769D/image-dimensions/732x138?v=v2" width="732" height="138" role="button" title="sara93_2-1709927524693.png" alt="sara93_2-1709927524693.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2024 19:52:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/how-to-calculate-total-groub-by-column-and-percent/m-p/919548#M17903</guid>
      <dc:creator>sara93</dc:creator>
      <dc:date>2024-03-08T19:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate total groub by column and percent</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/how-to-calculate-total-groub-by-column-and-percent/m-p/919578#M17904</link>
      <description>&lt;P&gt;If you are using Visual Analytics 7.5x on SAS 9.4, then I'm afraid you are out of luck here. There is no way I'm aware of to get 100% for the subtotals in that release I'm afraid. This is due to the nature of that automatic calculated subtotals. You would have to do these calculations in your raw data before loading to LASR/Visual Analytics, then they would be have like normal measures rather than calculated aggregations, and would sum the way you are expecting.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If you are using SAS Viya however, there is a workaround. The automatic calculated subtotals does behave the same way here as it does in SAS 9.4, BUT there is an aggregated measure function called AggregateTable that will allow us to manually create the same calculation, and get the sum to work the way you would like.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;To achieve this, you would need to create a calculated item that looks like this. I have substituted your column names so hopefully you can just copy and paste this into a new calculated item:&lt;BR /&gt;&lt;BR /&gt;Sum [_ByGroup_] ('Parc actif'n) / AggregateTable(_Sum_, Table(_Sum_, Fixed('Categorie'n), 'Parc actif'n))&lt;BR /&gt;&lt;BR /&gt;The first part,&amp;nbsp;Sum [_ByGroup_] ('Parc actif'n), is just the normal sum for each Categorie/Operatuer combination. &lt;BR /&gt;The second part, AggregateTable(_Sum_, Table(_Sum_, Fixed('Categorie'n), 'Parc actif'n)) is the sum of just the Categorie data item.&amp;nbsp;&lt;BR /&gt;And of course dividing the two gets us the subtotal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then when you turn on subtotals in the crosstab, it should get you that 100%. I've mocked up an example here using the SASHELP.CARS data with Origin, Type, and MSRP so you can see the difference:&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="HunterT_SAS_0-1709933009091.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/94520i25A1C43F52EAE542/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HunterT_SAS_0-1709933009091.png" alt="HunterT_SAS_0-1709933009091.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-inline" image-alt="HunterT_SAS_1-1709933046513.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/94521iF6AA2AB55CF802A5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HunterT_SAS_1-1709933046513.png" alt="HunterT_SAS_1-1709933046513.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hopefully that helps you out!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2024 21:24:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/how-to-calculate-total-groub-by-column-and-percent/m-p/919578#M17904</guid>
      <dc:creator>HunterT_SAS</dc:creator>
      <dc:date>2024-03-08T21:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate total groub by column and percent</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/how-to-calculate-total-groub-by-column-and-percent/m-p/920098#M17911</link>
      <description>&lt;P&gt;T&lt;SPAN&gt;hank you for your response. Unfortunately, I am working with SAS VA 7.5 on SAS 9.4. Therefore, I will need to perform these calculations on my raw data before loading it into LASR/Visual Analytics.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 11:12:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/how-to-calculate-total-groub-by-column-and-percent/m-p/920098#M17911</guid>
      <dc:creator>sara93</dc:creator>
      <dc:date>2024-03-13T11:12:00Z</dc:date>
    </item>
  </channel>
</rss>

