<?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: Using set analysis + aggregation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-set-analysis-aggregation/m-p/1461725#M458707</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This one was the closest to the answer -- for the record, this is what I needed:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=SUM(&lt;/P&gt;&lt;P&gt;Aggr(&lt;/P&gt;&lt;P&gt;If(VISIT_ORDER = Min({&amp;lt;DIALYIS_DX_GROUPING = {'AFTER DIALYSIS'}&amp;gt;} TOTAL &amp;lt;PAT_ID&amp;gt; VISIT_ORDER), COUNT_ADMITS_365, 0)&lt;/P&gt;&lt;P&gt;, PAT_ID, VISIT_ORDER))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to everyone!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Jan 2018 15:14:40 GMT</pubDate>
    <dc:creator>koscumbs</dc:creator>
    <dc:date>2018-01-10T15:14:40Z</dc:date>
    <item>
      <title>Using set analysis + aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Using-set-analysis-aggregation/m-p/1461721#M458703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to perform a function on a column, but only where certain conditions are met.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The example is a healthcare dataset -- I have ~100,000 unique patients, and I have ~700,000 unique encounters with those patients. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've created a variable called "VISIT_ORDER," which is simply a ranking of the patients visit sequence.&amp;nbsp; I also have a variable which specifies the patient's dialysis status on the encounter level: whether the patient is not currently on dialysis, if they currently are on dialysis, or if they've never been on dialysis during the time window.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to average a column with the first visit a patient has (my thought was minimizing VISIT_ORDER) after they've been on dialysis.&amp;nbsp; In my set analysis, I want to return the result of the row where VISIT_ORDER = the minimum VISIT_ORDER where DIALYSIS_DX_GROUPING = 'AFTER DIALYSIS', then to average &lt;SPAN style="font-size: 13.3333px;"&gt;COUNT_ADMITS_365 for those rows&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I think what I need to do is some variant of this below, but while what I have works for one patient (when I've been troubleshooting), I'm having issues:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;=avg(&lt;/P&gt;&lt;P&gt;{&amp;lt;VISIT_ORDER = {"$(=aggr(min({&amp;lt;DIALYIS_DX_GROUPING = {'AFTER DIALYSIS'}&amp;gt;}VISIT_ORDER),PAT_ID))"}&amp;gt;}&lt;/P&gt;&lt;P&gt;COUNT_ADMITS_365)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue I'm having I believe is with the dollar-sign expansion, and also why the function appears to work with a single patient (PAT_ID is the unique patient identifier).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Any help would be appreciated; driving myself nuts over here.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jan 2018 19:35:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-set-analysis-aggregation/m-p/1461721#M458703</guid>
      <dc:creator>koscumbs</dc:creator>
      <dc:date>2018-01-09T19:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: Using set analysis + aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Using-set-analysis-aggregation/m-p/1461722#M458704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;An advanced search is creating an hyper cube with &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;VISIT_ORDER &lt;/SPAN&gt;as dimension and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;=avg({&amp;lt;VISIT_ORDER = {"=&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;VISIT_ORDER = &lt;/SPAN&gt;aggr(min({&amp;lt;DIALYIS_DX_GROUPING = {'AFTER DIALYSIS'}&amp;gt;}VISIT_ORDER),PAT_ID)"}&amp;gt;} &lt;/STRONG&gt;&lt;STRONG&gt;COUNT_ADMITS_365)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jan 2018 01:40:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-set-analysis-aggregation/m-p/1461722#M458704</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2018-01-10T01:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using set analysis + aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Using-set-analysis-aggregation/m-p/1461723#M458705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stephen Koscumb,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you share with me samples data and result you want?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Justin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jan 2018 02:46:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-set-analysis-aggregation/m-p/1461723#M458705</guid>
      <dc:creator>justinphamvn</dc:creator>
      <dc:date>2018-01-10T02:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using set analysis + aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Using-set-analysis-aggregation/m-p/1461724#M458706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum(Aggr(If(&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;VISIT_ORDER = Min(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;{&amp;lt;DIALYIS_DX_GROUPING = {'AFTER DIALYSIS'}&amp;gt;} &lt;/SPAN&gt;TOTAL &amp;lt;PAT_ID&amp;gt; &lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;VISIT_ORDER), 1, 0), PAT_ID, VISIT_ORDER))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jan 2018 09:30:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-set-analysis-aggregation/m-p/1461724#M458706</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-01-10T09:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using set analysis + aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Using-set-analysis-aggregation/m-p/1461725#M458707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This one was the closest to the answer -- for the record, this is what I needed:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=SUM(&lt;/P&gt;&lt;P&gt;Aggr(&lt;/P&gt;&lt;P&gt;If(VISIT_ORDER = Min({&amp;lt;DIALYIS_DX_GROUPING = {'AFTER DIALYSIS'}&amp;gt;} TOTAL &amp;lt;PAT_ID&amp;gt; VISIT_ORDER), COUNT_ADMITS_365, 0)&lt;/P&gt;&lt;P&gt;, PAT_ID, VISIT_ORDER))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to everyone!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jan 2018 15:14:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-set-analysis-aggregation/m-p/1461725#M458707</guid>
      <dc:creator>koscumbs</dc:creator>
      <dc:date>2018-01-10T15:14:40Z</dc:date>
    </item>
  </channel>
</rss>

