<?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 Simple Date Comparison Example in Set Analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Simple-Date-Comparison-Example-in-Set-Analysis/m-p/483023#M180518</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could someone please tell me if it is possible to use set analysis in this very simple sum example?&amp;nbsp;&amp;nbsp; Just trying to sum up Hours IF the HourDate is between Date1 and Date2.&amp;nbsp;&amp;nbsp; I am having trouble getting this to work on a large dataset where using If/Then is far too slow and not an option)&amp;nbsp; &lt;/P&gt;&lt;P&gt;I am afraid this is impossible in set analysis, if it is, I would really appreciate suggestions!&amp;nbsp; &lt;/P&gt;&lt;P&gt;THANK YOU!&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG.png" class="jive-image" height="242" src="https://community.qlik.com/legacyfs/online/48601_Capture.PNG.png" width="756" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Nov 2013 18:06:41 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-11-05T18:06:41Z</dc:date>
    <item>
      <title>Simple Date Comparison Example in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-Date-Comparison-Example-in-Set-Analysis/m-p/483023#M180518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could someone please tell me if it is possible to use set analysis in this very simple sum example?&amp;nbsp;&amp;nbsp; Just trying to sum up Hours IF the HourDate is between Date1 and Date2.&amp;nbsp;&amp;nbsp; I am having trouble getting this to work on a large dataset where using If/Then is far too slow and not an option)&amp;nbsp; &lt;/P&gt;&lt;P&gt;I am afraid this is impossible in set analysis, if it is, I would really appreciate suggestions!&amp;nbsp; &lt;/P&gt;&lt;P&gt;THANK YOU!&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG.png" class="jive-image" height="242" src="https://community.qlik.com/legacyfs/online/48601_Capture.PNG.png" width="756" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Nov 2013 18:06:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-Date-Comparison-Example-in-Set-Analysis/m-p/483023#M180518</guid>
      <dc:creator />
      <dc:date>2013-11-05T18:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Date Comparison Example in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-Date-Comparison-Example-in-Set-Analysis/m-p/483024#M180519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If Date1 and Date2 are field names instead of variables then you probably won't get the results you want. The set is calculated per chart, not per row. See this document for an explanation: &lt;A _jive_internal="true" href="https://community.qlik.com/docs/DOC-4563" style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3778c7; background-color: #f8fbfe;"&gt;set_analysis_intra-record.qvw&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the fields are all in the same table you can create a field in the script that flags if the condition is true or false:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load Date1, Date2, HourDate, Hours, Project,&lt;/P&gt;&lt;P&gt;if(HourDate &amp;gt;=Date1 and HourDate&amp;lt;=Date2,1,0) as Flag&lt;/P&gt;&lt;P&gt;from ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can then use that flag field in the set analysis expression: sum({&amp;lt;Flag={1}&amp;gt;}Hours)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Nov 2013 18:12:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-Date-Comparison-Example-in-Set-Analysis/m-p/483024#M180519</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-11-05T18:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Date Comparison Example in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-Date-Comparison-Example-in-Set-Analysis/m-p/483025#M180520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, the referral to the example : &lt;A _jive_internal="true" data-containerid="2049" data-containertype="14" data-objectid="4563" data-objecttype="102" href="https://community.qlik.com/docs/DOC-4563"&gt;set_analysis_intra-record.qvw&lt;/A&gt; did the trick!&amp;nbsp;&amp;nbsp; In this case I am able to use a unique index on the data rows so the Flag is not needed, although that's a great idea as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the benefit of anyone coming along later, here is a picture of the final solution:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/48604_Capture.PNG.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Nov 2013 19:19:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-Date-Comparison-Example-in-Set-Analysis/m-p/483025#M180520</guid>
      <dc:creator />
      <dc:date>2013-11-05T19:19:53Z</dc:date>
    </item>
  </channel>
</rss>

