<?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: Converting Date Range IF Statement to Set Analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353220#M415552</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be these?&lt;/P&gt;&lt;P&gt;1) Count({&amp;lt;BegDateOfOperation = {'&amp;lt;= $(vAsOfDate)'}, EndDateOfOperation = {'&amp;gt; $(vAsOfDate)'}&amp;gt;}%PropertyKey)&lt;/P&gt;&lt;P&gt;2) Count(&amp;nbsp; {&amp;lt;BegDateOfOperation ={"&amp;lt;=$(=num(vMaxDate))"}, EndDateOfOperation ={"&amp;gt;$(=num(vMaxDate))"}&amp;gt;} distinct %PropertyKey)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 May 2017 16:50:57 GMT</pubDate>
    <dc:creator>Anil_Babu_Samineni</dc:creator>
    <dc:date>2017-05-02T16:50:57Z</dc:date>
    <item>
      <title>Converting Date Range IF Statement to Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353216#M415548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a straight table that calculates the difference between active properties on one date vs. active properties on another date. Currently, I am using an IF statement in the expression to first determine whether a property was active on a date. Instead, I would like to use set analysis to do the very same thing. Attached is a sample app with sample data. Any help would be greatly appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 May 2017 16:39:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353216#M415548</guid>
      <dc:creator>alexandergrando</dc:creator>
      <dc:date>2017-05-02T16:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Date Range IF Statement to Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353217#M415549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-1208"&gt;The Basics about Dates, Date Ranges and Set Analysis&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 May 2017 16:44:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353217#M415549</guid>
      <dc:creator>m_woolf</dc:creator>
      <dc:date>2017-05-02T16:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Date Range IF Statement to Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353218#M415550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be like attached&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 May 2017 16:46:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353218#M415550</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-05-02T16:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Date Range IF Statement to Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353219#M415551</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;Try this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count(&amp;nbsp; {&amp;lt;BegDateOfOperation ={"&amp;lt;=$(vAsOfDate)"}, EndDateOfOperation ={"&amp;gt;$(vAsOfDate)"}&amp;gt;}Distinct %PropertyKey)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count(&amp;nbsp; {&amp;lt;BegDateOfOperation ={"&amp;lt;=$(=num(vMaxDate))"}, EndDateOfOperation ={"&amp;gt;$(=num(vMaxDate))"}&amp;gt;} distinct %PropertyKey)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kaushik Solanki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 May 2017 16:48:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353219#M415551</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2017-05-02T16:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Date Range IF Statement to Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353220#M415552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be these?&lt;/P&gt;&lt;P&gt;1) Count({&amp;lt;BegDateOfOperation = {'&amp;lt;= $(vAsOfDate)'}, EndDateOfOperation = {'&amp;gt; $(vAsOfDate)'}&amp;gt;}%PropertyKey)&lt;/P&gt;&lt;P&gt;2) Count(&amp;nbsp; {&amp;lt;BegDateOfOperation ={"&amp;lt;=$(=num(vMaxDate))"}, EndDateOfOperation ={"&amp;gt;$(=num(vMaxDate))"}&amp;gt;} distinct %PropertyKey)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 May 2017 16:50:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353220#M415552</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-05-02T16:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Date Range IF Statement to Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353221#M415553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you taking the time to look at my app and provide a correct answer! If it's not too much to ask, can you take a look at another one of my straight tables for a similar problem, please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This time, I'm trying to SUM TotalUnitCount instead of COUNT %PropertyKey. The problem is that I either get zero or a number higher than the total sum when I try using set analysis. Can you please convert the IF statements to set analysis again? Attached is a new sample app with updated sample data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: It's probably worth mentioning that TotalUnitCount belongs to a %PropertyKey. So, an aggregate statement is probably needed, but I can't figure it out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 May 2017 18:39:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353221#M415553</guid>
      <dc:creator>alexandergrando</dc:creator>
      <dc:date>2017-05-02T18:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Date Range IF Statement to Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353222#M415554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check it out&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 May 2017 18:42:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353222#M415554</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-05-02T18:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Date Range IF Statement to Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353223#M415555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes! That works. Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 May 2017 18:51:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353223#M415555</guid>
      <dc:creator>alexandergrando</dc:creator>
      <dc:date>2017-05-02T18:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Date Range IF Statement to Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353224#M415556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again, Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hate to bother you again, but your code started acting strangely upon closer examination. &lt;SPAN style="font-size: 13.3333px;"&gt;I noticed that &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;none of a specific %PropertyKey will be counted if there is more than one occurrence of that %PropertyKey once applied on the entire data set. The funny thing is that I was unable to replicate the results on the smaller data set I provided even after going in and creating duplicates in it.&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;&lt;SPAN style="font-size: 10pt;"&gt;Can you kindly provide a few alternative set analysis expressions to SUM TotalUnitCount belonging to %PropertyKey, please? I am unable to figure out how to include an aggregation in set analysis because I am still very new to QlikView. Thanks again.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 May 2017 15:55:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353224#M415556</guid>
      <dc:creator>alexandergrando</dc:creator>
      <dc:date>2017-05-03T15:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Date Range IF Statement to Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353225#M415557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that is true... I gave the expression believing that you are checking the sum of TotalUnitCount on %PropertyKey level.... but if you are not and duplicate %PropertyKey are causing issues for you then you will have to look for an alternative. What that alternative can be would depend on your actual data and need. Would you be able to elaborate the business requirement a little more explaining what exactly are you looking to get?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 May 2017 16:25:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353225#M415557</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-05-03T16:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Date Range IF Statement to Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353226#M415558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your continued support. My goal is to use set analysis throughout my app since it requires less resources. The app is being designed to show important information related to property management of apartment complexes. This mostly includes metrics related to the COUNT of number of different properties managed by different dimensions like region, owner, etc. The same is the case with the SUM of units within each property. &lt;SPAN style="font-size: 10pt;"&gt;I have the sections of the app related to properties completed. &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;&lt;SPAN style="font-size: 10pt;"&gt;Now I need to finish the sections related to units. &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;Most of the time, I can get by with using the following expression to SUM TotalUnitCount of each %PropertyKey where vMaxDate is a variable that takes the date of a calendar object assigned to a field called "CalendarDate" from a MasterCalendar dimension:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;=SUM({&amp;lt;BegDateOfOperation={'&amp;lt;=$(vMaxDate)'}, EndDateOfOperation={'&amp;gt;$(vMaxDate)'}&amp;gt;} TotalUnitCount)&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;&lt;SPAN style="font-size: 10pt;"&gt;However, one section requires me to calculate the difference between unit counts from two different days specified by two calendar objects. I am able to successfully SUM one TotalUnitCount using the above expression for the calendar object assigned to "CalendarDate". But I am unable to get any results for the other calendar object assigned to the vAsOfDate variable. The variable vAsOfDate is not assigned to any field:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;=SUM({&amp;lt;BegDateOfOperation={'&amp;lt;=$(vAsOfDate)'}, EndDateOfOperation={'&amp;gt;$(&lt;SPAN style="font-size: 13.3333px;"&gt;vAsOfDate&lt;/SPAN&gt;)'}&amp;gt;} TotalUnitCount)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;That is why I originally made this post. All I need is for a set analysis expression to SUM TotalUnitCount belonging to a calendar object assigned to vAsOfDate. You were almost able to provide a perfect solution with your expression, except that it ignores duplicates.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 May 2017 18:43:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353226#M415558</guid>
      <dc:creator>alexandergrando</dc:creator>
      <dc:date>2017-05-03T18:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Date Range IF Statement to Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353227#M415559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am starting to get some hang of it... is it possible that a single %PropertyKey can be associated with more than one BegDateOfOperation and/or EndDateOfOperation? If that may be the case, then you might benefit by creating a new field in the script like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD %PropertyKey, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BegDateOfOperation, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EndDateOfOperation,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;AutoNumber(%PropertyKey &amp;amp; BegDateOfOperation &amp;amp; EndDateOfOperation) as NewKey,&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TotalUnitCount&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;C&gt;&lt;/C&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(ooxml, embedded labels, table is Sheet2);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and now use NewKey as your set analysis dimension&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SUM({&amp;lt;&lt;STRONG style="color: #ff0000; font-size: 13.3333px;"&gt;NewKey&lt;/STRONG&gt; = {"=BegDateOfOperation &amp;lt;= (vAsOfDate) and EndDateOfOperation &amp;gt; (vAsOfDate)"}&amp;gt;} TotalUnitCount)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, the idea is to create a most granular key where we can check the inside conditon of&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;BegDateOfOperation &amp;lt;= (vAsOfDate) and EndDateOfOperation &amp;gt; (vAsOfDate)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem (from what I see is that) a single %PropertyKey might be associated with multiple BegDateOfOperation which is a problem. To see the problem create an object with the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dimension&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;%PropertyKey&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expressions&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;BegDateOfOperation&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;EndDateOfOperation&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;vAsOfDate&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;BegDateOfOperation &amp;lt;= (vAsOfDate)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;EndDateOfOperation &amp;gt; (vAsOfDate)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will see that whereever there are more than one BegDateOfOperation and/or EndDateOfOperation, one or both of your last two expressions are not able to give any output (will be null instead of 0 and -1). Our goal is to use a dimension where we can evaluate the last two expressions and based on that evaluation, pick those rows where we see -1. My hope is that once you add NewKey to your dimension (instead of %PropertyKey), you will start to see 0 and -1s for all the rows. If this is true, I am almost certain your issue should be resolved by using NewKey instead of %PropertyKey in your expression above&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 May 2017 20:36:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353227#M415559</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-05-03T20:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Date Range IF Statement to Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353228#M415560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are absolutely right. The original and duplicate properties and their associated units are not being calculated because they have more than one BegDateOfOperation and EndDateOfOperation. I was able to confirm this via creating an object with the dimensions and expressions you mentioned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, a property should not have more than one &lt;SPAN style="font-size: 13.3333px;"&gt;BegDateOfOperation and EndDateOfOperation. The ones that do are the duplicates and are bad data that did not get filtered out properly. With this in mind, is there a possible solution without having to go into the script?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 May 2017 20:52:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353228#M415560</guid>
      <dc:creator>alexandergrando</dc:creator>
      <dc:date>2017-05-03T20:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Date Range IF Statement to Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353229#M415561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might be able to use Aggr() function to get the desired output, but if you want to use set analysis, you will require to make some changes in the script. Having said that, lets try what &lt;A href="https://community.qlik.com/people/kaushik.solanki"&gt;kaushik.solanki&lt;/A&gt;‌ provided below to see if this fits your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({&amp;lt;BegDateOfOperation ={"&amp;lt;=$(vAsOfDate)"}, EndDateOfOperation ={"&amp;gt;$(vAsOfDate)"}&amp;gt;} TotalUnitCount)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, instead of focusing on %PropertyKey, we are directly restricting the expression to look at rows where BegDateOfOperation is less then or equal to vAsOfDate and EndDateOfOperation is greater than vAsOfDate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See if this provides you with the output you are looking to get.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 May 2017 20:58:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353229#M415561</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-05-03T20:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Date Range IF Statement to Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353230#M415562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, Kaushik's solution did not work. I get zeroes as values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 May 2017 21:01:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353230#M415562</guid>
      <dc:creator>alexandergrando</dc:creator>
      <dc:date>2017-05-03T21:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Date Range IF Statement to Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353231#M415563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It did work for me in the sample you have attached... but dates in set analysis can cause a lot of problems.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="162099" alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/162099_Capture.PNG" style="height: 289px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;You have to ensure that the date format inside your set modifier matches with the format your date field. If lets say the format of your date field is M/D/YYYY, but your variable gives a number, the set analysis will not work. So, if that is the case, you might need to throw in a date function like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Sum({&amp;lt;BegDateOfOperation ={"&amp;lt;=$(=Date(vAsOfDate, 'M/D/YYYY'))"}, EndDateOfOperation ={"&amp;gt;$(&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;=Date(vAsOfDate, 'M/D/YYYY')&lt;/STRONG&gt;&lt;/SPAN&gt;)"}&amp;gt;} TotalUnitCount)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The best way to ensure what the dollar sign expansion is to remove the expression label&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="162100" alt="Capture.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/162100_Capture.PNG" style="height: 302px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you remove it, the expression will show the evaluated version of the set analysis expression. See if this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 May 2017 21:08:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353231#M415563</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-05-03T21:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Date Range IF Statement to Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353232#M415564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes! That worked! Thanks a thousand times, Sunny. I know I will be referring back to this thread for a long time to come.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 May 2017 21:15:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353232#M415564</guid>
      <dc:creator>alexandergrando</dc:creator>
      <dc:date>2017-05-03T21:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Date Range IF Statement to Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353233#M415565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome, I am glad we were able to help you out here&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 May 2017 21:16:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Date-Range-IF-Statement-to-Set-Analysis/m-p/1353233#M415565</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-05-03T21:16:26Z</dc:date>
    </item>
  </channel>
</rss>

