<?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: Set analysis with 'or' in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-or/m-p/737604#M1053380</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jakub,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Apologies for the delayed response. Your solution works perfectly, i didnt realise that you could write set analysis in this way so thank you for showing me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Nov 2014 14:25:45 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-11-13T14:25:45Z</dc:date>
    <item>
      <title>Set analysis with 'or'</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-or/m-p/737602#M1053376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a dataset in QlikView where a single case can have a number of letters that have been sent, say letter A and letter B.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The calculation i am trying to perform in set analysis is if a case has had letter A sent before or on its due date, or letter B was sent before the case was 5 days old then count the case as being compliant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have added the relevant flags and fields to enable me to perform the above in set analysis however, there are a handful of cases that meet both conditions, these cases are subsequently being counted twice. Is there any way i can ensure that each case is only counted once?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An example of my set analysis is (I have simplified this as there is a lot of conditions in that set analysis that aren't relevant to this question - i am more looking for advice on how to approach the issue that the code to make it work):&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;=&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; font-size: 8pt;"&gt;num&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;SPAN style="color: blue;"&gt;count&lt;/SPAN&gt;(&lt;SPAN style="color: blue;"&gt;DISTINCT&lt;/SPAN&gt;{&amp;lt;&lt;BR /&gt;&lt;SPAN style="color: maroon;"&gt;ACTION_DESCRIPTION&lt;/SPAN&gt;={&lt;SPAN style="color: maroon;"&gt;"letter A"&lt;/SPAN&gt;},&lt;BR /&gt;&lt;SPAN style="color: maroon;"&gt;ACTION_OUTCOME_DESCRIPTION&lt;/SPAN&gt;={Complete},&lt;BR /&gt;&lt;SPAN style="color: maroon;"&gt;OUTCOME_DATE&lt;/SPAN&gt;={&lt;SPAN style="color: maroon;"&gt;"&amp;lt;=$(=date(vCurrentPeriodEnd))&amp;gt;=$(=date(vCurrentPeriodStart))"&lt;/SPAN&gt;},&lt;BR /&gt;&amp;gt;}&lt;SPAN style="color: maroon;"&gt;Case_Dimension_ID&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;+&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: blue;"&gt;count&lt;/SPAN&gt;(&lt;SPAN style="color: blue;"&gt;DISTINCT&lt;/SPAN&gt;{&amp;lt;&lt;BR /&gt;&lt;SPAN style="color: maroon;"&gt;ACTION_DESCRIPTION&lt;/SPAN&gt;={&lt;SPAN style="color: maroon;"&gt;"Letter B"&lt;/SPAN&gt;},&lt;BR /&gt;&lt;SPAN style="color: maroon;"&gt;OUTCOME_DATE&lt;/SPAN&gt;={&lt;SPAN style="color: maroon;"&gt;"&amp;lt;=$(=date(vCurrentPeriodEnd))&amp;gt;=$(=date(vCurrentPeriodStart))"&lt;/SPAN&gt;},&lt;BR /&gt;&lt;SPAN style="color: maroon;"&gt;ACTION_OUTCOME_DESCRIPTION&lt;/SPAN&gt;={Complete},&lt;BR /&gt;&lt;SPAN style="color: maroon;"&gt;CASE_AGE_CALC&lt;/SPAN&gt;={&lt;SPAN style="color: maroon;"&gt;"&amp;lt;=5"&lt;/SPAN&gt;},&lt;BR /&gt;&amp;gt;}&lt;SPAN style="color: maroon;"&gt;Case_Dimension_ID&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 7.5pt;"&gt;),0.0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;vCurrentPeriodStart and vCurrentPeriodEnd are just variables that define the start and end of the current reporting period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any advice/thoughts would be greatly appreciated&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Oct 2014 08:56:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-or/m-p/737602#M1053376</guid>
      <dc:creator />
      <dc:date>2014-10-16T08:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with 'or'</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-or/m-p/737603#M1053378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can sum both sets before you calculate. That way, the records that would appear in both sets are counted only once in the resulting sum of sets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's your expression changed to work this way:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14136185482222872" jivemacro_uid="_14136185482222872" modifiedtitle="true"&gt;
&lt;P&gt;num(count(DISTINCT&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;lt;ACTION_DESCRIPTION={"letter A"},&lt;/P&gt;
&lt;P&gt;ACTION_OUTCOME_DESCRIPTION={Complete},&lt;/P&gt;
&lt;P&gt;OUTCOME_DATE={"&amp;lt;=$(=date(vCurrentPeriodEnd))&amp;gt;=$(=date(vCurrentPeriodStart))"}&amp;gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;+&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;&amp;lt;ACTION_DESCRIPTION={"Letter B"},&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;OUTCOME_DATE={"&amp;lt;=$(=date(vCurrentPeriodEnd))&amp;gt;=$(=date(vCurrentPeriodStart))"},&lt;/P&gt;
&lt;P&gt;ACTION_OUTCOME_DESCRIPTION={Complete},&lt;/P&gt;
&lt;P&gt;CASE_AGE_CALC={"&amp;lt;=5"}&amp;gt;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;Case_Dimension_ID),0.0)&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Oct 2014 07:51:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-or/m-p/737603#M1053378</guid>
      <dc:creator>kuba_michalik</dc:creator>
      <dc:date>2014-10-18T07:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with 'or'</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-or/m-p/737604#M1053380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jakub,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Apologies for the delayed response. Your solution works perfectly, i didnt realise that you could write set analysis in this way so thank you for showing me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Nov 2014 14:25:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-or/m-p/737604#M1053380</guid>
      <dc:creator />
      <dc:date>2014-11-13T14:25:45Z</dc:date>
    </item>
  </channel>
</rss>

