<?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 Using a variable inside set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-a-variable-inside-set-analysis/m-p/1150927#M631352</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having an issue using a variable I created inside set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using this formula:&lt;/P&gt;&lt;P&gt;=count({&amp;lt;ProviderFullNM=, CareProcessNM ={$(vCPRK1)},ThreeCaseMinFLG = {'Y'}&amp;gt;}FacilityAccountID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to display the value in a text box but I'm getting the "Error in set modifier ad hoc element list" error.&lt;/P&gt;&lt;P&gt;The value of the variable does however display in a list box object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I set the variable in the script as below:&lt;/P&gt;&lt;P&gt;SET vCPRK1 =if(aggr(rank(count(DISTINCT FacilityAccountID)),CareProcessNM)='1',CareProcessNM);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried every variation I can find to get this to work and I can't seem to get it working. Can someone please help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Aug 2016 17:36:14 GMT</pubDate>
    <dc:creator>trmcbrad</dc:creator>
    <dc:date>2016-08-08T17:36:14Z</dc:date>
    <item>
      <title>Using a variable inside set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-inside-set-analysis/m-p/1150927#M631352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having an issue using a variable I created inside set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using this formula:&lt;/P&gt;&lt;P&gt;=count({&amp;lt;ProviderFullNM=, CareProcessNM ={$(vCPRK1)},ThreeCaseMinFLG = {'Y'}&amp;gt;}FacilityAccountID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to display the value in a text box but I'm getting the "Error in set modifier ad hoc element list" error.&lt;/P&gt;&lt;P&gt;The value of the variable does however display in a list box object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I set the variable in the script as below:&lt;/P&gt;&lt;P&gt;SET vCPRK1 =if(aggr(rank(count(DISTINCT FacilityAccountID)),CareProcessNM)='1',CareProcessNM);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried every variation I can find to get this to work and I can't seem to get it working. Can someone please help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2016 17:36:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-inside-set-analysis/m-p/1150927#M631352</guid>
      <dc:creator>trmcbrad</dc:creator>
      <dc:date>2016-08-08T17:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable inside set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-inside-set-analysis/m-p/1150928#M631353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=count({&amp;lt;ProviderFullNM=, CareProcessNM ={"=$(vCPRK1)"},ThreeCaseMinFLG = {'Y'}&amp;gt;}FacilityAccountID)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;with a definition like&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;SET vCPRK1 = rank(count(DISTINCT FacilityAccountID))=1;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2016 18:15:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-inside-set-analysis/m-p/1150928#M631353</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-08-08T18:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable inside set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-inside-set-analysis/m-p/1150929#M631354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I account for a tie in this ranking? Currently when there are two Care Processes with the same case counts the variable does not work when being used in the set modifier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2016 21:05:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-inside-set-analysis/m-p/1150929#M631354</guid>
      <dc:creator>trmcbrad</dc:creator>
      <dc:date>2016-08-08T21:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable inside set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-inside-set-analysis/m-p/1150930#M631355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should be able to achieve this using the optional arguments to rank, these control the function behaviour in case of ties.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #edf8ca;"&gt;SET vCPRK1 = rank(count(DISTINCT FacilityAccountID)&lt;STRONG&gt;,1&lt;/STRONG&gt;)=1;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2016 21:42:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-inside-set-analysis/m-p/1150930#M631355</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-08-08T21:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable inside set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-inside-set-analysis/m-p/1150931#M631356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm still getting some ties using this formula. Is there another field i can use to break this tie? Could it be something like the avg cost of the CareProcess that would break the tie?&lt;/P&gt;&lt;P&gt;Thanks again for your help!&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/134065_Capture.JPG" style="height: 230px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2016 13:29:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-inside-set-analysis/m-p/1150931#M631356</guid>
      <dc:creator>trmcbrad</dc:creator>
      <dc:date>2016-08-09T13:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable inside set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-inside-set-analysis/m-p/1150932#M631357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If that's what you want to use to create your rank and use it as tie breaker, you can maybe use it like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET vCPRK1 = Rank( Count(DISTINCT FacilityAccount) &lt;STRONG&gt;+1/Sum(Cost)&lt;/STRONG&gt; ,1) =1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The basic idea is, that the count will return an integer, to break the ties for the same count, add a small number &amp;lt; 1.&lt;/P&gt;&lt;P&gt;1/ Sum(Cost) will return (assuming Sum(Cost) is larger than 1) a small number &amp;lt;1, the less cost the higher the value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hence Care processes with least count will be ranked top on processes with same count.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2016 18:12:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-inside-set-analysis/m-p/1150932#M631357</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-08-09T18:12:55Z</dc:date>
    </item>
  </channel>
</rss>

