<?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 KPI for count the number of selection in a filter in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/KPI-for-count-the-number-of-selection-in-a-filter/m-p/967093#M18780</link>
    <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;BR /&gt;I need to create a kpi with a measure where i can count the number of selection in a global filter. This filter have multiselection and is Date type. Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 21 May 2025 10:03:56 GMT</pubDate>
    <dc:creator>LeviSche</dc:creator>
    <dc:date>2025-05-21T10:03:56Z</dc:date>
    <item>
      <title>KPI for count the number of selection in a filter</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/KPI-for-count-the-number-of-selection-in-a-filter/m-p/967093#M18780</link>
      <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;BR /&gt;I need to create a kpi with a measure where i can count the number of selection in a global filter. This filter have multiselection and is Date type. Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 21 May 2025 10:03:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/KPI-for-count-the-number-of-selection-in-a-filter/m-p/967093#M18780</guid>
      <dc:creator>LeviSche</dc:creator>
      <dc:date>2025-05-21T10:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: KPI for count the number of selection in a filter</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/KPI-for-count-the-number-of-selection-in-a-filter/m-p/967100#M18781</link>
      <description>&lt;P&gt;You should be able to do this by creating a Distinct Count of your Date data item, then using that new measure in the KPI.&lt;/P&gt;
&lt;P&gt;1. Right-click on the Date data item and select New Calculation&lt;/P&gt;
&lt;P&gt;2. First option should be Distinct so create that&lt;/P&gt;
&lt;P&gt;3. Use that distinct count in the KPI&lt;/P&gt;
&lt;P&gt;4. Ensure the list control filters the KPI.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now by doing this if you have 0 selections in the list, then the KPI is going to show a distinct count of all date items (because it's not being filtered by anything). If you need the KPI to show 0 then you can take the following extra steps:&lt;BR /&gt;&lt;BR /&gt;1. Right-click on the List control and select New Parameter&lt;/P&gt;
&lt;P&gt;2. Create the new parameter, you shouldn't need to make any changes to it aside from the name if you want&lt;/P&gt;
&lt;P&gt;3. Back on the KPI, add a local filter that does something like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;IsSet&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Date Parameter'p&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt; &lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;ELSE&lt;/SPAN&gt; &lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;BR /&gt;This is checking to see if the Date Parameter is set (meaning at least one selection has been made). If so, then we return true, else we return false.&amp;nbsp;&lt;BR /&gt;When it's all done it should work like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HunterT_SAS_0-1747828855075.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107188iBA384A370328154F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HunterT_SAS_0-1747828855075.png" alt="HunterT_SAS_0-1747828855075.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="HunterT_SAS_1-1747828879744.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107189iC03FC852B70F3566/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HunterT_SAS_1-1747828879744.png" alt="HunterT_SAS_1-1747828879744.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 May 2025 12:01:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/KPI-for-count-the-number-of-selection-in-a-filter/m-p/967100#M18781</guid>
      <dc:creator>HunterT_SAS</dc:creator>
      <dc:date>2025-05-21T12:01:49Z</dc:date>
    </item>
  </channel>
</rss>

