<?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 : combining conditions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-combining-conditions/m-p/519268#M1141073</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gilles,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure you can perform this kind of Set Analysis, as Set Analysis only gets evaluated one time prior to the calculation. I don't think there is a way for Set Analysis to vary on a row by row basis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on the size of your dataset, you could use an expression similar to the following:&lt;/P&gt;&lt;P&gt;=count(if ([&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #ff0000;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;DEnd&lt;/STRONG&gt;&lt;/SPAN&gt;]-[&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #ff0000;"&gt;DStart&lt;/STRONG&gt;]&amp;lt;4, if(monthstart(&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #ff0000;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;DEnd&lt;/STRONG&gt;&lt;/SPAN&gt;]) = monthstart(&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #ff0000;"&gt;DStart&lt;/STRONG&gt;), [IncidentID])))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This could cause performance issues on a very large dataset. Alternatively, you could introduce a change to your load script that flags each row based on whether or not it was closed in the same month as it was opened, and also add a calculated field with the duration. Then you could combine two Set Analysis modifiers for these new fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Sep 2013 16:16:30 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-09-13T16:16:30Z</dc:date>
    <item>
      <title>Set analysis : combining conditions</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-combining-conditions/m-p/519266#M1141071</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 an issue with a report i'm not able to build :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have as input a list of incidents (&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;IncidentID&lt;/STRONG&gt;&lt;/SPAN&gt;) with for each opening (&lt;SPAN style="color: #800000;"&gt;&lt;STRONG style="color: #ff0000;"&gt;DStart&lt;/STRONG&gt;&lt;/SPAN&gt;) and closing (&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;DEnd&lt;/STRONG&gt;&lt;/SPAN&gt;) dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm looking to build an expression that combine the to following needs and count each incidents that :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Have been closed the same month of the opening ( monthstart(&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;DEnd&lt;/STRONG&gt;&lt;/SPAN&gt;) = monthstart(&lt;STRONG style="color: #ff0000;"&gt;DStart&lt;/STRONG&gt;) )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and have a duration : &lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;DEnd&lt;/STRONG&gt;&lt;/SPAN&gt; - &lt;STRONG style="color: #ff0000;"&gt;DStart&lt;/STRONG&gt; &amp;lt; 4hours&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 15:02:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-combining-conditions/m-p/519266#M1141071</guid>
      <dc:creator />
      <dc:date>2013-09-13T15:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis : combining conditions</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-combining-conditions/m-p/519267#M1141072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something like this perhaps:&lt;/P&gt;&lt;P&gt;count({&amp;lt;IncidentID={'=monthstart(DEnd)=monthstart(DStart) and DEnd-DStart&amp;lt;1/6'}&amp;gt;} IncidentID)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 16:12:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-combining-conditions/m-p/519267#M1141072</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-09-13T16:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis : combining conditions</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-combining-conditions/m-p/519268#M1141073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gilles,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure you can perform this kind of Set Analysis, as Set Analysis only gets evaluated one time prior to the calculation. I don't think there is a way for Set Analysis to vary on a row by row basis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on the size of your dataset, you could use an expression similar to the following:&lt;/P&gt;&lt;P&gt;=count(if ([&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #ff0000;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;DEnd&lt;/STRONG&gt;&lt;/SPAN&gt;]-[&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #ff0000;"&gt;DStart&lt;/STRONG&gt;]&amp;lt;4, if(monthstart(&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #ff0000;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;DEnd&lt;/STRONG&gt;&lt;/SPAN&gt;]) = monthstart(&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #ff0000;"&gt;DStart&lt;/STRONG&gt;), [IncidentID])))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This could cause performance issues on a very large dataset. Alternatively, you could introduce a change to your load script that flags each row based on whether or not it was closed in the same month as it was opened, and also add a calculated field with the duration. Then you could combine two Set Analysis modifiers for these new fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 16:16:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-combining-conditions/m-p/519268#M1141073</guid>
      <dc:creator />
      <dc:date>2013-09-13T16:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis : combining conditions</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-combining-conditions/m-p/519269#M1141074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would calculate 2 flags at script level&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) if(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;monthstart(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #ff0000;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;DEnd&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;) = monthstart(&lt;/SPAN&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #ff0000;"&gt;DStart&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;) &lt;/SPAN&gt;,1,0) as FlagSameMonth&lt;/P&gt;&lt;P&gt;2) if(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #ff0000;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;DEnd&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; - &lt;/SPAN&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #ff0000;"&gt;DStart&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; &amp;lt; 4&lt;/SPAN&gt;,1,0) as FlagDuration&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, your expression could be&lt;/P&gt;&lt;P&gt;count({&amp;lt;FlagSameMonth={"1"},FlagDuration={"1"}&amp;gt;}&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;IncidentID&lt;/SPAN&gt; )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 16:18:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-combining-conditions/m-p/519269#M1141074</guid>
      <dc:creator>Clever_Anjos</dc:creator>
      <dc:date>2013-09-13T16:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis : combining conditions</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-combining-conditions/m-p/519270#M1141075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks everyone, both solution works well !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Sep 2013 13:30:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-combining-conditions/m-p/519270#M1141075</guid>
      <dc:creator />
      <dc:date>2013-09-16T13:30:18Z</dc:date>
    </item>
  </channel>
</rss>

