<?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 Expression.... in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression/m-p/479644#M481699</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 like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;sum({$&amp;lt;Contract_Create_Date_Num = {"&amp;gt;=$(=max([Camp_Start_Date_Num]))&amp;lt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;$(=&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;max([Camp_end_Date_Num]))"}&amp;gt;} [Subtotal 1])&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Sep 2013 19:31:28 GMT</pubDate>
    <dc:creator>MayilVahanan</dc:creator>
    <dc:date>2013-09-25T19:31:28Z</dc:date>
    <item>
      <title>Set Analysis Expression....</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression/m-p/479641#M481696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;I am trying to use set analysis to sum a dollar value if the document create date is between two other dates, however it says there is nothing wrong with the syntax it's not working.&amp;nbsp; Does anyone see anything wrong with my statement?&amp;nbsp; All dates have been converted to numeric fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Contract_Create_Date_Num = {"&amp;gt;=[Camp_Start_Date_Num]&amp;lt;=[Camp_end_Date_Num]"}&amp;gt;} [Subtotal 1]) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Sep 2013 19:02:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression/m-p/479641#M481696</guid>
      <dc:creator>tmumaw</dc:creator>
      <dc:date>2013-09-25T19:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Expression....</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression/m-p/479642#M481697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Hi, you must peek only one value, not all of them.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;So you need to use max, min, only, etc.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Use like this:&lt;BR /&gt;&lt;BR /&gt;sum({$&amp;lt;Contract_Create_Date_Num = {"&amp;gt;=$(=max([Camp_Start_Date_Num]))&amp;lt;=&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;$(=&lt;/SPAN&gt;max([Camp_end_Date_Num]))"}&amp;gt;} [Subtotal 1])&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Sep 2013 19:09:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression/m-p/479642#M481697</guid>
      <dc:creator />
      <dc:date>2013-09-25T19:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Expression....</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression/m-p/479643#M481698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can only guess that the reason is that there are multiple values available for your start and end dates, and therefore the expression cannot be rendered globally. To overcome that, I'd try to look for a level of detail that can guarantee that the two fields are unique. For example, if those fields are unique per Contract, then I'd reformat your condition like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Contract_ID = {"Contract_Create_Date_Num&amp;gt;=[Camp_Start_Date_Num] and Contract_Create_Date_Num&amp;lt;=[Camp_end_Date_Num]"}&amp;gt;} [Subtotal 1])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the two fields are still not unique per contract, you may have to use min() or max() to arrive to the single value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The other way of solving it would be calculating a flag in the script (assuming that the three date fields are easily accessible) and assigning 1 to the contracts that fit your condition. Then, the set analysis becomes very simple:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Contract_Date_Flag = {1}&amp;gt;} [Subtotal 1])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.masterssummit.com/"&gt;www.masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Sep 2013 19:14:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression/m-p/479643#M481698</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2013-09-25T19:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Expression....</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression/m-p/479644#M481699</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 like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;sum({$&amp;lt;Contract_Create_Date_Num = {"&amp;gt;=$(=max([Camp_Start_Date_Num]))&amp;lt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;$(=&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;max([Camp_end_Date_Num]))"}&amp;gt;} [Subtotal 1])&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Sep 2013 19:31:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression/m-p/479644#M481699</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2013-09-25T19:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Expression....</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression/m-p/479645#M481700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Oleg, &lt;/P&gt;&lt;P&gt;I have a group of contracts which were created on different days. I have a group of campaigns which has a start dates and an end dates. I need to see if the contract create date falls within the valid start and end dates for the&lt;BR /&gt;campaign. When I use this ({&amp;lt;&lt;SPAN style="color: maroon;"&gt;Contract_Create_Date_Num &lt;/SPAN&gt;= {&lt;SPAN style="color: maroon;"&gt;"&amp;gt;=41449 &amp;lt;=41479"&lt;/SPAN&gt;}&amp;gt; } &lt;SPAN style="color: maroon;"&gt;[Subtotal 1]&lt;/SPAN&gt;) (as a test it works fine).&amp;nbsp; When I try and add the logic you and the rest of the forum provided it doesn’t work.&amp;nbsp; I’m confused…..&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;Thom&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Sep 2013 23:19:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression/m-p/479645#M481700</guid>
      <dc:creator>tmumaw</dc:creator>
      <dc:date>2013-09-25T23:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Expression....</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression/m-p/479646#M481701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oleg,&lt;/P&gt;&lt;P&gt;Thanks for your help.&amp;nbsp; After reviewing the model, a few left joins here and a resident table here I was able to use the simple method.&amp;nbsp; Made my life much easier.&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Thom&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Contract_Date_Flag = {1}&amp;gt;} [Subtotal 1])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S. Thanks to everyone else to for the suggestions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Sep 2013 18:30:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression/m-p/479646#M481701</guid>
      <dc:creator>tmumaw</dc:creator>
      <dc:date>2013-09-26T18:30:18Z</dc:date>
    </item>
  </channel>
</rss>

