<?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 Set analysis problem, pivot table expression, missing data. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-problem-pivot-table-expression-missing-data/m-p/237604#M501683</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That did the job thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Mar 2011 15:55:06 GMT</pubDate>
    <dc:creator>thomastc</dc:creator>
    <dc:date>2011-03-04T15:55:06Z</dc:date>
    <item>
      <title>Set analysis problem, pivot table expression, missing data.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-problem-pivot-table-expression-missing-data/m-p/237601#M501680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class="MsoNoSpacing" style="margin: 0cm 0cm 0pt;"&gt;This is my scenario:&lt;/P&gt;&lt;P class="MsoNoSpacing" style="margin: 0cm 0cm 0pt;"&gt;&lt;/P&gt;&lt;P class="MsoNoSpacing" style="margin: 0cm 0cm 0pt;"&gt;I have a list of patients. Each patient has been enrolled on a trail. Each patient could have enrolled on a different date. We need to look at the number of admissions for each patient for the year before the trial started and the year following the trial. I have constructed some set analysis that does what I need and appears to work, it is used as the expression in a pivot table.&lt;/P&gt;&lt;P class="MsoNoSpacing" style="margin: 0cm 0cm 0pt;"&gt;&lt;/P&gt;&lt;P class="MsoNoSpacing" style="margin: 0cm 0cm 0pt;"&gt;I tested the set analysis with an individual patient selected and got the results I expected. However when I removed the selection from the patients instead of seeing a populated pivot with all the patients in my group the table was empty. If I select an individual patient I see results... what am I doing wrong?&lt;/P&gt;&lt;P class="MsoNoSpacing" style="margin: 0cm 0cm 0pt;"&gt;&lt;/P&gt;&lt;P class="MsoNoSpacing" style="margin: 0cm 0cm 0pt;"&gt;Here is the set analysis for getting the previous year:&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;=NumericCount({$&amp;lt;DischargeDate ={"&amp;gt;=$(=date(AddYears(date(ServiceStartDate), -1), 'DD/MM/YYYY HH:MM:SS'))&amp;lt;$(=date(ServiceStartDate, 'DD/MM/YYYY HH:MM:SS'))"}&amp;gt;}DischargeDate)&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;/P&gt;&lt;P class="MsoNoSpacing" style="margin: 0cm 0cm 0pt;"&gt;The set analysis for getting the current year is:&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;=NumericCount({$&amp;lt;DischargeDate ={"&amp;gt;=$(=date(ServiceStartDate, 'DD/MM/YYYY HH:MM:SS'))"}&amp;gt;}DischargeDate)&lt;/P&gt;&lt;P class="MsoNoSpacing" style="margin: 0cm 0cm 0pt;"&gt;&lt;/P&gt;&lt;P class="MsoNoSpacing" style="margin: 0cm 0cm 0pt;"&gt;Can anyone explain why my pivot is empty unless I have a patient selected?&lt;/P&gt;&lt;P class="MsoNoSpacing" style="margin: 0cm 0cm 0pt;"&gt;&lt;/P&gt;&lt;P class="MsoNoSpacing" style="margin: 0cm 0cm 0pt;"&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2011 16:55:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-problem-pivot-table-expression-missing-data/m-p/237601#M501680</guid>
      <dc:creator>thomastc</dc:creator>
      <dc:date>2011-03-03T16:55:27Z</dc:date>
    </item>
    <item>
      <title>Set analysis problem, pivot table expression, missing data.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-problem-pivot-table-expression-missing-data/m-p/237602#M501681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Set analysis is calculated once per chart, not once per row which is why it works fine when you have only one selected, but doesn't work when you have multiple patients in the chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you need to do is something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=count(if([DischargeDate]&amp;gt;=date(AddYears(date(ServiceStartDate), -1) And [DischargeDate]&amp;lt;=date(ServiceStartDate, 'DD/MM/YYYY HH:MM:SS'), [DischargeDate]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might need to use aggr but off the top of my head I'm not sure. Also not sure how to change the text color...&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2011 18:09:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-problem-pivot-table-expression-missing-data/m-p/237602#M501681</guid>
      <dc:creator />
      <dc:date>2011-03-03T18:09:58Z</dc:date>
    </item>
    <item>
      <title>Set analysis problem, pivot table expression, missing data.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-problem-pivot-table-expression-missing-data/m-p/237603#M501682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the response, I'll let you know how I get on.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2011 09:12:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-problem-pivot-table-expression-missing-data/m-p/237603#M501682</guid>
      <dc:creator>thomastc</dc:creator>
      <dc:date>2011-03-04T09:12:00Z</dc:date>
    </item>
    <item>
      <title>Set analysis problem, pivot table expression, missing data.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-problem-pivot-table-expression-missing-data/m-p/237604#M501683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That did the job thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2011 15:55:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-problem-pivot-table-expression-missing-data/m-p/237604#M501683</guid>
      <dc:creator>thomastc</dc:creator>
      <dc:date>2011-03-04T15:55:06Z</dc:date>
    </item>
  </channel>
</rss>

