<?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 Set Analysis : using conditions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-using-conditions/m-p/217248#M70488</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi !&lt;/P&gt;&lt;P&gt;I noticed that sometimes&lt;/P&gt;&lt;P&gt;[CODE]&lt;BR /&gt;=sum({$&amp;lt;Year=,Month=&amp;gt;} if(Year=$(=Year) and Month=$(=Month), [MyField]))&lt;BR /&gt;[/CODE]&lt;/P&gt;&lt;P&gt;doesn't give the same result than&lt;/P&gt;&lt;P&gt;[CODE]&lt;BR /&gt;=sum({$} [MyField])&lt;BR /&gt;[/CODE]&lt;/P&gt;&lt;P&gt;where "Year" and "Month" are in the selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to know how I can use &lt;I&gt;complex conditions&lt;/I&gt; in the set analysis statement.&lt;/P&gt;&lt;P&gt;I would like to use a "lower than" and "greater than" and variables and functions.&lt;/P&gt;&lt;P&gt;For instance, I would like to say "only take the values where the date is between a specific date (the selection) and today".&lt;/P&gt;&lt;P&gt;Something like :&lt;/P&gt;&lt;P&gt;[CODE]&lt;BR /&gt;=sum({$&amp;lt;Year=,Month=,Day=,Date={"&amp;gt;=" &amp;amp; makedate($(=Year), $(=Month), $(=Day)) &amp;amp; "&amp;lt;=" today()}&amp;gt; [MyField])&lt;BR /&gt;[/CODE]&lt;/P&gt;&lt;P&gt;Unfortunately, the usage of "&amp;amp;" for the concatenation doesn't seems to work, neither the usage of a function like "makedate" &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even when I set hard values, it doesn't work :&lt;/P&gt;&lt;P&gt;[CODE]&lt;BR /&gt;=sum({$&amp;lt;Year=,Month=,Day=,Date={"&amp;gt;2008-01-01&amp;lt;2010-01-01"}&amp;gt; [MyField])&lt;BR /&gt;[/CODE]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Jan 2010 09:44:52 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-01-20T09:44:52Z</dc:date>
    <item>
      <title>Set Analysis : using conditions</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-using-conditions/m-p/217248#M70488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi !&lt;/P&gt;&lt;P&gt;I noticed that sometimes&lt;/P&gt;&lt;P&gt;[CODE]&lt;BR /&gt;=sum({$&amp;lt;Year=,Month=&amp;gt;} if(Year=$(=Year) and Month=$(=Month), [MyField]))&lt;BR /&gt;[/CODE]&lt;/P&gt;&lt;P&gt;doesn't give the same result than&lt;/P&gt;&lt;P&gt;[CODE]&lt;BR /&gt;=sum({$} [MyField])&lt;BR /&gt;[/CODE]&lt;/P&gt;&lt;P&gt;where "Year" and "Month" are in the selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to know how I can use &lt;I&gt;complex conditions&lt;/I&gt; in the set analysis statement.&lt;/P&gt;&lt;P&gt;I would like to use a "lower than" and "greater than" and variables and functions.&lt;/P&gt;&lt;P&gt;For instance, I would like to say "only take the values where the date is between a specific date (the selection) and today".&lt;/P&gt;&lt;P&gt;Something like :&lt;/P&gt;&lt;P&gt;[CODE]&lt;BR /&gt;=sum({$&amp;lt;Year=,Month=,Day=,Date={"&amp;gt;=" &amp;amp; makedate($(=Year), $(=Month), $(=Day)) &amp;amp; "&amp;lt;=" today()}&amp;gt; [MyField])&lt;BR /&gt;[/CODE]&lt;/P&gt;&lt;P&gt;Unfortunately, the usage of "&amp;amp;" for the concatenation doesn't seems to work, neither the usage of a function like "makedate" &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even when I set hard values, it doesn't work :&lt;/P&gt;&lt;P&gt;[CODE]&lt;BR /&gt;=sum({$&amp;lt;Year=,Month=,Day=,Date={"&amp;gt;2008-01-01&amp;lt;2010-01-01"}&amp;gt; [MyField])&lt;BR /&gt;[/CODE]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2010 09:44:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-using-conditions/m-p/217248#M70488</guid>
      <dc:creator />
      <dc:date>2010-01-20T09:44:52Z</dc:date>
    </item>
    <item>
      <title>Set Analysis : using conditions</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-using-conditions/m-p/217249#M70489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;here are an example for a date range.&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;P&gt;Rainer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2010 10:12:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-using-conditions/m-p/217249#M70489</guid>
      <dc:creator />
      <dc:date>2010-01-20T10:12:13Z</dc:date>
    </item>
    <item>
      <title>Set Analysis : using conditions</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-using-conditions/m-p/217250#M70490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The formula in your document is &lt;B&gt;quite&lt;/B&gt; the same that the formula I used... but it works &lt;IMG alt="Indifferent" src="http://community.qlik.com/emoticons/emotion-8.gif" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This makes me feel like crazy...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(big thank you &lt;IMG alt="Big Smile" src="http://community.qlik.com/emoticons/emotion-2.gif" /&gt; )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2010 11:42:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-using-conditions/m-p/217250#M70490</guid>
      <dc:creator />
      <dc:date>2010-01-20T11:42:01Z</dc:date>
    </item>
  </channel>
</rss>

