<?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: Count all possible from alternate state in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1710092#M54526</link>
    <description>&lt;P&gt;May be include the patient dimension as well in aggr(), like:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;aggr(if(rank([Admit Date])=1,[Admit Date]),&lt;STRONG&gt;[Patient ID],&lt;/STRONG&gt;[Encounter Number])&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Jun 2020 07:39:55 GMT</pubDate>
    <dc:creator>tresB</dc:creator>
    <dc:date>2020-06-11T07:39:55Z</dc:date>
    <item>
      <title>Count all possible from alternate state</title>
      <link>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1705894#M54117</link>
      <description>&lt;P&gt;Hey Qlik Sense Community, reaching out because I am at the end of my rope with a particular problem.&lt;/P&gt;&lt;P&gt;In a KPI object in an alternate state, I am attempting to count all possible encounter numbers of patient numbers that are currently selected in the default state. What I have written works great when the selections I have made in the default state are 1-to-1&amp;nbsp; with the patient number, but when there are multiple instances of the same patient number, Qlik Sense throws out all countable encounters, returning 0 for that count. Here is what I have written:&lt;/P&gt;&lt;P&gt;count(distinct aggr(nodistinct only({$&amp;lt;[Encounter Number]=P([Encounter Number])&amp;gt;}[Encounter Number]),[Patient Number]))))&lt;/P&gt;&lt;P&gt;Imagine the table looks something like:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;[Patient Number]&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;[Encounter Number]&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;[Diagnosis]&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;1357&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;1234&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;470&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;2468&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;5678&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;871&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;5790&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;9101&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;470&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;1256&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;1213&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;470&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;2367&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;1415&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;871&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;1357&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;1617&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;470&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;2675&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;1819&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;234&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have selected in the default state the Diagnosis 470. I would expect my KPI to return 4, though it returns 2, as patient number 1357 occurs twice. When I select Diagnosis 871, I return 2, and I select Diagnosis 234, I return 1.&lt;/P&gt;&lt;P&gt;Any thoughts here would be super helpful. I've played around with this for a couple of weeks, but this is as close as I've gotten. I suspect maybe there is a conflict of some sort around the distinct/nodistinct usage, but I have not&amp;nbsp; been able to figure it out.&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2020 05:42:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1705894#M54117</guid>
      <dc:creator>sgagliardi</dc:creator>
      <dc:date>2020-05-28T05:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: Count all possible from alternate state</title>
      <link>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1705896#M54118</link>
      <description>&lt;P&gt;I don't see an alternate state (except the default) in your expression that confuses me about how it is relevant here. Also would request you to explain a bit more about your requirement comparing how it would be different if you use a simpler expression like &lt;FONT face="courier new,courier"&gt;Count([Encounter Number])&lt;/FONT&gt;&amp;nbsp;, may be with an example (in the light of different selections).&lt;/P&gt;&lt;P&gt;Perhaps there could be a simpler expression.&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2020 06:15:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1705896#M54118</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2020-05-28T06:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Count all possible from alternate state</title>
      <link>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1705897#M54119</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;your expression return 2 because your aggr function try to build a table with one line for each patient&lt;/P&gt;&lt;P&gt;so for patient 1357 the only function returns null ,&amp;nbsp;&lt;BR /&gt;if you want to count patients than replace your formula to this&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;count(distinct aggr(nodistinct only({$&amp;lt;[Encounter Number]=P([Encounter Number])&amp;gt;}[Patient Number]),[Patient Number]))&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;if you want to count encounters than use this one&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;count(distinct aggr(nodistinct only({$&amp;lt;[Encounter Number]=P([Encounter Number])&amp;gt;}[Encounter Number]),[Encounter Number],[Patient Number]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2020 06:11:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1705897#M54119</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2020-05-28T06:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: Count all possible from alternate state</title>
      <link>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1706069#M54129</link>
      <description>&lt;P&gt;Hey Tresesco,&lt;/P&gt;&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;The alternate state is set on the object itself in settings, and is necessary for separating it from the default state. I apologize for not explaining better, and I also left out some important information from my example.&lt;/P&gt;&lt;P&gt;Imagine the table looks something like:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;[Patient Number]&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;[Encounter Number]&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;[Diagnosis]&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;1357&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;1234&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;470&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;2468&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;5678&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;871&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;5790&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;9101&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;470&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;1256&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;1213&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;470&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;2367&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;1415&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;871&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;1357&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;1617&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;470&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;1357&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;2456&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;871&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;2675&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;1819&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="24px"&gt;234&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've added an additional row here, one with a patient number of 1357, and diagnosis of 871. I have selected in the default state the Diagnosis 470. I would now expect my KPI to return 5, though it returns 3. What should be included in the count is all instances of Diagnosis 470, plus a count of all excluded encounter numbers that share a patient number with those rows containing 470. I would want the instance of 1357 with diagnosis 871 to be included in the count also. This is the reason I am using the alternate state, as we are essentially making selections over top of the default selections.&lt;/P&gt;&lt;P&gt;When I select Diagnosis 871, I return 5, and I select Diagnosis 234, I return 1, as these diagnosis have a one-t-one match of the diagnosis to the patient number, whereas Diagnosis 470 has a duplicate instance of patient number 1357.&lt;/P&gt;&lt;P&gt;I hope that this makes what I'm attempting to do a little more clear.&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2020 14:30:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1706069#M54129</guid>
      <dc:creator>sgagliardi</dc:creator>
      <dc:date>2020-05-28T14:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Count all possible from alternate state</title>
      <link>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1706104#M54131</link>
      <description>&lt;P&gt;I guess you need:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Count({1&amp;lt;[Patient Number]=p({&amp;lt;[Patient Number]&amp;gt;})&amp;gt;}[Encounter Number])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need distinct or not...you can decide based on your data possibility&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2020 15:38:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1706104#M54131</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2020-05-28T15:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Count all possible from alternate state</title>
      <link>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1706302#M54150</link>
      <description>&lt;P&gt;Tresesco, again, thank you so much for your help.&lt;/P&gt;&lt;P&gt;I've been working with the syntax you provided earlier. It works great independent of the alternate state I was using. I'd like to escape using the alternate state on objects if possible, but I've run into a more complex problem as a result.&lt;/P&gt;&lt;P&gt;What I was doing was counting the values described in response to user inputs passed with a variable to count only encounter numbers falling within a date range relative to the date of the selected encounter(s). I was referencing the date of the selected encounter number in the default state, and establishing the date range to be plus and minus however many days the user inputs. What I would count is the encounters that fall within that range that also share a selected patient number. This is what I have so for, no alternate state applied to the KPI object:&lt;/P&gt;&lt;P&gt;=count(distinct {1&amp;lt;[Patient Number]=p({&amp;lt;[Patient Number]&amp;gt;})&amp;gt;}&lt;BR /&gt;if(&lt;BR /&gt;num(aggr(nodistinct only({1&amp;lt;[Patient Number]=p({&amp;lt;[Patient Number]&amp;gt;})&amp;gt;}[Admit Date]),[Encounter number]))-num([Admit Date])&lt;BR /&gt;&amp;lt;=$(DaysAfter)&lt;BR /&gt;and&lt;BR /&gt;num(aggr(nodistinct only({1&amp;lt;[Patient Number]=p({&amp;lt;[Patient Number]&amp;gt;})&amp;gt;}[Admit Date]),[Encounter Number]))-num([Admit Date])&lt;BR /&gt;&amp;gt;=$(DaysBefore),&lt;BR /&gt;[Encounter Number])&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;I think my problem might be how I'm referencing the selected encounter numbers. I'm getting the full count I would expect from the expression you provided, but I can't get the KPI to respond to the user inputs as it was before.&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2020 21:40:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1706302#M54150</guid>
      <dc:creator>sgagliardi</dc:creator>
      <dc:date>2020-05-28T21:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Count all possible from alternate state</title>
      <link>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1706352#M54153</link>
      <description>&lt;P&gt;I wouldn't say that I have understood all you are trying to do, however, it seems that you need not put the date range condition outside the main count() but inside making the expression simpler. My suggestion to you would be to create a sample app where we can see what/how you are trying to do - may be, we would be able to play with the same sample app and come up with something meaningful in terms of a possible solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also please try to explain the expected output against multiple controls (like selections and inputs) in the context of same sample app.&lt;/P&gt;</description>
      <pubDate>Fri, 29 May 2020 05:34:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1706352#M54153</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2020-05-29T05:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Count all possible from alternate state</title>
      <link>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1706358#M54154</link>
      <description>&lt;P&gt;Hi Tresesco,&lt;/P&gt;&lt;P&gt;By bringing the date range condition inside of the main count(), do you mean converting it to a set analysis of the count()?&lt;/P&gt;&lt;P&gt;What I am trying to make happen is the syntax you had shared earlier:&lt;/P&gt;&lt;P&gt;count(distinct {1&amp;lt;[Patient Number]=p({&amp;lt;[Patient Number]&amp;gt;})&amp;gt;}[Encounter Number])&lt;/P&gt;&lt;P&gt;But do this within a particular date range that is determined based upon an input. The expression I had shared earlier does this fine (though it could probably be simplified), but for instances where a [Patient Number] occurs twice within a selection, it exclude the whole [Patient Number], dropping all of it's possible [Encounter Numbers] from the count.&lt;/P&gt;&lt;P&gt;I will see about trying to build an example app that I can share. The data I work with is big, sensitive in nature, and the app I'm working on is proprietary. I'll need to model some data and and Qlik objects with similar qualities that describe my scenario.&lt;/P&gt;&lt;P&gt;Again, really appreciate you help with this!&lt;/P&gt;</description>
      <pubDate>Fri, 29 May 2020 06:06:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1706358#M54154</guid>
      <dc:creator>sgagliardi</dc:creator>
      <dc:date>2020-05-29T06:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: Count all possible from alternate state</title>
      <link>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1706443#M54157</link>
      <description>&lt;P&gt;I would wait for the sample app.&lt;/P&gt;</description>
      <pubDate>Fri, 29 May 2020 10:07:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1706443#M54157</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2020-05-29T10:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: Count all possible from alternate state</title>
      <link>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1707221#M54229</link>
      <description>&lt;P&gt;Hey Tresesco,&lt;/P&gt;&lt;P&gt;Thanks again for your help.&lt;/P&gt;&lt;P&gt;Attached is a model for what I am attempting to achieve.&lt;/P&gt;&lt;P&gt;I've loaded some dummy data which includes [Patient Number], [Encounter Number], [Diagnosis Code], and [Admit Date].&lt;/P&gt;&lt;P&gt;In the attached app you'll fine 2 KPI objects, a variable input selector, selection filters, and an index table.&lt;/P&gt;&lt;P&gt;What we are trying to do is get a count of all encounter numbers associated with patient numbers captured in a data selection, with admit dates occurring between however many days before, and however may days after (as input by the user) the admit date of the selected patient number's index encounter number(s). In this example I am using diagnosis code as my selection criteria, but this could be any criteria.&lt;/P&gt;&lt;P&gt;To replicate the behavior I've described, select a diagnosis code (pretty much any one). You'll find that in most cases this is a 1 to 1 match, with the diagnosis criteria usually having 1 encounter number, and 1 patient number counted in the Index KPI. The continuum KPI will return a count of all other encounter numbers associated with the selected patient number(s) that occur between the date range created by the user's inputs relative to the admit date of the selected index encounter for that MRN.&lt;/P&gt;&lt;P&gt;Now, select Diagnosis Code 'M457'. Find that the Index KPI reflects 2 encounter numbers, and 1 patient, indicating that the same patient has two encounter numbers that occur within the diagnosis selection. Find in the continuum KPI, that the count returns 0 encounters for this patient number, while we would expect a count of several encounter numbers.&lt;/P&gt;&lt;P&gt;I believe that this has to do with the expression not identifying which of the two available encounter numbers of the patient ID selected in the index criteria to take the admit date from. I have yet to be able to figure out how to solve this.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2020 18:23:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1707221#M54229</guid>
      <dc:creator>sgagliardi</dc:creator>
      <dc:date>2020-06-01T18:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Count all possible from alternate state</title>
      <link>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1709245#M54446</link>
      <description>&lt;P&gt;I finally figured it out. If anyone is interested, below is my solution:&lt;/P&gt;&lt;P&gt;=count({1&amp;lt;[Patient ID]=p({&amp;lt;[Patient ID]&amp;gt;}),[Admit Date]={"$(= '&amp;gt;=' &amp;amp; date($(DateofIndex)+$(ContinuumB)) &amp;amp; '&amp;lt;=' &amp;amp; date($(DateofIndex)+$(ContinuumA)))"}&amp;gt;} distinct [Encounter Number])&lt;/P&gt;&lt;P&gt;//$(DateofIndex)=aggr(if(rank(num([Admit Date]))=1,[Admit Date]),[Encounter Number])&lt;BR /&gt;//$(ContinuumA)= User Input&lt;BR /&gt;//$(ContinuumB)= User Input&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2020 04:37:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1709245#M54446</guid>
      <dc:creator>sgagliardi</dc:creator>
      <dc:date>2020-06-09T04:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: Count all possible from alternate state</title>
      <link>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1709254#M54448</link>
      <description>&lt;P&gt;Great! So the date range condition finally within the count().&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2020 05:35:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1709254#M54448</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2020-06-09T05:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: Count all possible from alternate state</title>
      <link>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1709882#M54511</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22949"&gt;@tresB&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes! I credit you with the solution on this one for providing me the inspiration to approach it from another angle.&lt;/P&gt;&lt;P&gt;I feel like I've ALMOST got it down, but now I am struggling with the rank() function I'm using in the one variable to &lt;STRONG&gt;grab earliest occurring admit date for the selected encounter numbers for each patient number&lt;/STRONG&gt;. What the code is doing now is grabbing earliest admit date for the full selection, and not for each patient number. As a result, the date range build in set analysis considerably skews the count. Stumped again.&lt;/P&gt;&lt;P&gt;aggr(if(rank([Admit Date])=1,[Admit Date]),[Encounter Number])&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 18:16:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1709882#M54511</guid>
      <dc:creator>sgagliardi</dc:creator>
      <dc:date>2020-06-10T18:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: Count all possible from alternate state</title>
      <link>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1710092#M54526</link>
      <description>&lt;P&gt;May be include the patient dimension as well in aggr(), like:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;aggr(if(rank([Admit Date])=1,[Admit Date]),&lt;STRONG&gt;[Patient ID],&lt;/STRONG&gt;[Encounter Number])&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jun 2020 07:39:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1710092#M54526</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2020-06-11T07:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: Count all possible from alternate state</title>
      <link>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1718439#M54558</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22949"&gt;@tresB&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks for the suggestion! This returns for me the full sum or total, seemingly disregarding the date range that's being established in the set analysis.&lt;/P&gt;&lt;P&gt;I wonder however if perhaps this is creating the behavior I'm after, but instead counting encounters with admit dates occurring in any of the ranges being dynamically created for each MRN in the selection...&lt;/P&gt;&lt;P&gt;Still pecking away at it, this is proving to be a tricky problem.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 22:02:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-all-possible-from-alternate-state/m-p/1718439#M54558</guid>
      <dc:creator>sgagliardi</dc:creator>
      <dc:date>2020-06-12T22:02:45Z</dc:date>
    </item>
  </channel>
</rss>

