<?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: How to Group/ Count Records Based on an Aggregated Measure in SAS Visual Analytics in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-Group-Count-Records-Based-on-an-Aggregated-Measure-in-SAS/m-p/967102#M18782</link>
    <description>&lt;P&gt;I am not sure what the end result should look like, but I think you should be able to at least get what you need using an aggregated data source and a join.&amp;nbsp; Please keep in mind that this approach creates temporary tables in memory and can consume resources, so may not be appropriate if your data are large or if you have a large number of concurrent users.&amp;nbsp; Here are some steps I took to get the results and assumes you can change the input data slightly:&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp; Create a new variable in your source data that concatenates RESPONSE and CLAIM_ID (I called this RESPONSE_CLAIM)&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp; Once this has been added to your source table and reloaded, create a new measure (I called this REPONSE_COUNT) with logic similar to below:&lt;/P&gt;
&lt;P&gt;IF ( Substring('Response_Claim'n, 1, 3) = 'Tri' )&lt;BR /&gt;RETURN 1&lt;BR /&gt;ELSE 0&lt;/P&gt;
&lt;P&gt;3.&amp;nbsp; Create an aggregated data source using the concatenated data item and the calculated measure from above (RESPONSE_COUNT)&lt;/P&gt;
&lt;P&gt;4.&amp;nbsp; Join your original table with the aggregated data source using a left join with RESPONSE_CLAIM being the key and selecting the columns you would like to use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Again, I am not sure what your desired outcome is and this may need some tweaking, but the screenshot below shows a table showing the number of triggered alerts for claims.&amp;nbsp; This table filters the lower table that contains detail records so that clicking on the top table shows details for that claim.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-05-21 081804.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107190iB1EFFB6DC9EBCB06/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-05-21 081804.png" alt="Screenshot 2025-05-21 081804.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
    <pubDate>Wed, 21 May 2025 12:24:17 GMT</pubDate>
    <dc:creator>TSBruce</dc:creator>
    <dc:date>2025-05-21T12:24:17Z</dc:date>
    <item>
      <title>How to Group/ Count Records Based on an Aggregated Measure in SAS Visual Analytics</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-Group-Count-Records-Based-on-an-Aggregated-Measure-in-SAS/m-p/967085#M18779</link>
      <description>&lt;P class=""&gt;Hi everyone,&lt;/P&gt;&lt;P class=""&gt;I have alert-level data in SAS Visual Analytics. Each row corresponds to a specific alert (SCN) raised for a claim, and includes fields like CLAIM_ID, SCN_NAME (alert_id), RESPONSE&amp;nbsp;(which can be "Triggered" or "Not Triggered").&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="saunvida_1-1747816994729.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107187i310641FAC69DF640/image-size/medium?v=v2&amp;amp;px=400" role="button" title="saunvida_1-1747816994729.png" alt="saunvida_1-1747816994729.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;My goal is to build a visualization that shows: How many claims had 1 triggered alert, how many claims had 2 triggered alerts so on.&lt;/P&gt;&lt;P class=""&gt;So essentially I want to:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;Count the number of triggered alerts &lt;STRONG&gt;per claim&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;Then group claims by that count (e.g., 50 claims had 2 triggered alerts, 30 claims had 3, etc.)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P class=""&gt;I created an aggregated measure to count triggered alerts per claim:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="saunvida_0-1747816879178.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107186iCF2C65E3A1B6C37C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="saunvida_0-1747816879178.png" alt="saunvida_0-1747816879178.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P class=""&gt;But I’m stuck because I cannot group by this aggregated measure directly to count how many claims fall into each group (like "3 triggered alerts").&lt;/P&gt;&lt;P class=""&gt;Could someone guide me on how to do this in SAS VA 8.x? Do I need to use a custom category or prepare the data differently?&lt;/P&gt;&lt;P class=""&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 21 May 2025 08:48:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-Group-Count-Records-Based-on-an-Aggregated-Measure-in-SAS/m-p/967085#M18779</guid>
      <dc:creator>saunvida</dc:creator>
      <dc:date>2025-05-21T08:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to Group/ Count Records Based on an Aggregated Measure in SAS Visual Analytics</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-Group-Count-Records-Based-on-an-Aggregated-Measure-in-SAS/m-p/967102#M18782</link>
      <description>&lt;P&gt;I am not sure what the end result should look like, but I think you should be able to at least get what you need using an aggregated data source and a join.&amp;nbsp; Please keep in mind that this approach creates temporary tables in memory and can consume resources, so may not be appropriate if your data are large or if you have a large number of concurrent users.&amp;nbsp; Here are some steps I took to get the results and assumes you can change the input data slightly:&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp; Create a new variable in your source data that concatenates RESPONSE and CLAIM_ID (I called this RESPONSE_CLAIM)&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp; Once this has been added to your source table and reloaded, create a new measure (I called this REPONSE_COUNT) with logic similar to below:&lt;/P&gt;
&lt;P&gt;IF ( Substring('Response_Claim'n, 1, 3) = 'Tri' )&lt;BR /&gt;RETURN 1&lt;BR /&gt;ELSE 0&lt;/P&gt;
&lt;P&gt;3.&amp;nbsp; Create an aggregated data source using the concatenated data item and the calculated measure from above (RESPONSE_COUNT)&lt;/P&gt;
&lt;P&gt;4.&amp;nbsp; Join your original table with the aggregated data source using a left join with RESPONSE_CLAIM being the key and selecting the columns you would like to use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Again, I am not sure what your desired outcome is and this may need some tweaking, but the screenshot below shows a table showing the number of triggered alerts for claims.&amp;nbsp; This table filters the lower table that contains detail records so that clicking on the top table shows details for that claim.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-05-21 081804.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107190iB1EFFB6DC9EBCB06/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-05-21 081804.png" alt="Screenshot 2025-05-21 081804.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Wed, 21 May 2025 12:24:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-Group-Count-Records-Based-on-an-Aggregated-Measure-in-SAS/m-p/967102#M18782</guid>
      <dc:creator>TSBruce</dc:creator>
      <dc:date>2025-05-21T12:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to Group/ Count Records Based on an Aggregated Measure in SAS Visual Analytics</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-Group-Count-Records-Based-on-an-Aggregated-Measure-in-SAS/m-p/967505#M18788</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;Thank you for your earlier response. It was helpful as an intermediate step. I’d like to clarify my end goal a bit more clearly:&lt;/P&gt;&lt;P&gt;Ultimately,&amp;nbsp;I’m looking to create either a &lt;STRONG&gt;list table or a histogram&lt;/STRONG&gt; that shows how many claims have 1, 2, 3, 4, etc., alerts. Ideally, the final output would resemble something like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="saunvida_0-1748260350354.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107368i03BAC64B34AAEDE7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="saunvida_0-1748260350354.png" alt="saunvida_0-1748260350354.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So, the goal here is to see how many claims fall into each bucket of alert count.&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;I’d really appreciate your guidance on how best to structure this in SAS VA. Thanks again for your support!&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 26 May 2025 11:57:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-Group-Count-Records-Based-on-an-Aggregated-Measure-in-SAS/m-p/967505#M18788</guid>
      <dc:creator>saunvida</dc:creator>
      <dc:date>2025-05-26T11:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to Group/ Count Records Based on an Aggregated Measure in SAS Visual Analytics</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-Group-Count-Records-Based-on-an-Aggregated-Measure-in-SAS/m-p/967635#M18791</link>
      <description>&lt;P&gt;You should be able to get the results you want.&amp;nbsp; One quick correction on my last post - you will want to convert RESPONSE_COUNT in your aggregated data source to a category instead of leaving this as a measure.&amp;nbsp; once you have done this, you should be able to create a calculated data item in your joined data source that calculates the distinct count for CLAIM_ID.&amp;nbsp; You can then use&amp;nbsp;RESPONSE_COUNT (which is a category) and the distinct count of CLAIM_ID from the joined data source in your dashboard.&amp;nbsp; Below is an updated picture based on your requested changes.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Communities2.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107402i8BBF90C590552F4E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Communities2.png" alt="Communities2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 May 2025 18:04:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-Group-Count-Records-Based-on-an-Aggregated-Measure-in-SAS/m-p/967635#M18791</guid>
      <dc:creator>TSBruce</dc:creator>
      <dc:date>2025-05-28T18:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to Group/ Count Records Based on an Aggregated Measure in SAS Visual Analytics</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-Group-Count-Records-Based-on-an-Aggregated-Measure-in-SAS/m-p/970182#M18825</link>
      <description>&lt;P&gt;Thank you! This worked for me &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jul 2025 06:32:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-Group-Count-Records-Based-on-an-Aggregated-Measure-in-SAS/m-p/970182#M18825</guid>
      <dc:creator>saunvida</dc:creator>
      <dc:date>2025-07-03T06:32:41Z</dc:date>
    </item>
  </channel>
</rss>

