<?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: use max date &amp;lt; today in set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/use-max-date-lt-today-in-set-analysis/m-p/1207752#M387898</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Johan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there are a few problems here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Any Set Analysis filter should look like this:&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FieldName = {values}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can't formulate a Set Analysis filter starting with a function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Depending on the format of the variable date_today (dual or numeric), you may need to use it differently in Set Analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd suggest to use an Advanced Search condition (enclosed in double quotes and beginning with an equal sign), that helps with both issues. Something like this following should work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM(&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;lt;MasterCalander.Enddate = {"=max(&lt;SPAN style="font-size: 13.3333px;"&gt;MasterCalander.Enddate&lt;/SPAN&gt;) &amp;lt; date_today"} &amp;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; Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Advanced Search conditions, date fields can be freely compared to numeric fields and variables don't need to be enclosed in a $-sign expansion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;&lt;P&gt;Learn Set Analysis and many other advanced techniques in my book &lt;A href="http://www.amazon.com/gp/product/1118949552/ref=as_li_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=1118949552&amp;amp;linkCode=as2&amp;amp;tag=natursyner0f-20&amp;amp;linkId=CVZRHMG6CVR2FGTA"&gt;QlikView your Business&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Nov 2016 15:11:25 GMT</pubDate>
    <dc:creator>Oleg_Troyansky</dc:creator>
    <dc:date>2016-11-03T15:11:25Z</dc:date>
    <item>
      <title>use max date &lt; today in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/use-max-date-lt-today-in-set-analysis/m-p/1207751#M387897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a calendertable with startdates, enddates&amp;nbsp; and periodnames&lt;/P&gt;&lt;P&gt;I have sales with periodnames&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to sum sales with set analysis where max(enddate) &amp;lt; today() &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because i did not succeed i first tried to find the max date with :&lt;/P&gt;&lt;P&gt;=max({&amp;lt;date(floor(MasterCalander.Enddate),'DD-MM-YYYY') = {'&amp;lt; $(date_today)'} &amp;gt;}MasterCalander.enddate)&lt;/P&gt;&lt;P&gt;date_today is a variable containing function today()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don''t get any result. Searched this forum a lot, but nothing works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is wrong ??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2016 15:02:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/use-max-date-lt-today-in-set-analysis/m-p/1207751#M387897</guid>
      <dc:creator>curiousfellow</dc:creator>
      <dc:date>2016-11-03T15:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: use max date &lt; today in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/use-max-date-lt-today-in-set-analysis/m-p/1207752#M387898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Johan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there are a few problems here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Any Set Analysis filter should look like this:&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FieldName = {values}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can't formulate a Set Analysis filter starting with a function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Depending on the format of the variable date_today (dual or numeric), you may need to use it differently in Set Analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd suggest to use an Advanced Search condition (enclosed in double quotes and beginning with an equal sign), that helps with both issues. Something like this following should work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM(&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;lt;MasterCalander.Enddate = {"=max(&lt;SPAN style="font-size: 13.3333px;"&gt;MasterCalander.Enddate&lt;/SPAN&gt;) &amp;lt; date_today"} &amp;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; Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Advanced Search conditions, date fields can be freely compared to numeric fields and variables don't need to be enclosed in a $-sign expansion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;&lt;P&gt;Learn Set Analysis and many other advanced techniques in my book &lt;A href="http://www.amazon.com/gp/product/1118949552/ref=as_li_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=1118949552&amp;amp;linkCode=as2&amp;amp;tag=natursyner0f-20&amp;amp;linkId=CVZRHMG6CVR2FGTA"&gt;QlikView your Business&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2016 15:11:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/use-max-date-lt-today-in-set-analysis/m-p/1207752#M387898</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2016-11-03T15:11:25Z</dc:date>
    </item>
  </channel>
</rss>

