<?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 Multiple Dates within Expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Multiple-Dates-within-Expression/m-p/1329056#M410795</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Is it possible to create an expression that contains the equivalent of an OR statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL would be;&lt;/P&gt;&lt;P&gt;select sum(sales)&lt;/P&gt;&lt;P&gt;Where (Yearfield = 2017 AND Datefield &amp;lt;= '2017/05/10')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OR&lt;SPAN style="font-size: 13.3333px;"&gt; (Yearfield = 2016 AND Datefield &amp;lt;= &lt;SPAN style="font-size: 13.3333px;"&gt;'2016/05/10'&lt;/SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OR&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; (Yearfield = 2015 AND Datefield &amp;lt;= &lt;SPAN style="font-size: 13.3333px;"&gt;'2015/05/10'&lt;/SPAN&gt;)&lt;/SPAN&gt;&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;So I would end up with numbers for YTD 3 year comparison.&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;I want to use this to calculate an average so I can see how the average plots year on year after the same period.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 May 2017 16:07:32 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-05-11T16:07:32Z</dc:date>
    <item>
      <title>Multiple Dates within Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-Dates-within-Expression/m-p/1329056#M410795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Is it possible to create an expression that contains the equivalent of an OR statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL would be;&lt;/P&gt;&lt;P&gt;select sum(sales)&lt;/P&gt;&lt;P&gt;Where (Yearfield = 2017 AND Datefield &amp;lt;= '2017/05/10')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OR&lt;SPAN style="font-size: 13.3333px;"&gt; (Yearfield = 2016 AND Datefield &amp;lt;= &lt;SPAN style="font-size: 13.3333px;"&gt;'2016/05/10'&lt;/SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OR&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; (Yearfield = 2015 AND Datefield &amp;lt;= &lt;SPAN style="font-size: 13.3333px;"&gt;'2015/05/10'&lt;/SPAN&gt;)&lt;/SPAN&gt;&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;So I would end up with numbers for YTD 3 year comparison.&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;I want to use this to calculate an average so I can see how the average plots year on year after the same period.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 May 2017 16:07:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-Dates-within-Expression/m-p/1329056#M410795</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-11T16:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Dates within Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-Dates-within-Expression/m-p/1329057#M410796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you could try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;where yeartodate(Datefield,0) or yeartodate(Datefield,-1) or yeartodate(Datefield,-2) ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could also do this in a loop in combination with concatenate&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 May 2017 16:14:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-Dates-within-Expression/m-p/1329057#M410796</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-11T16:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Dates within Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-Dates-within-Expression/m-p/1329058#M410797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, John!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would it be usefull?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum(if(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Yearfield = 2017 AND Datefield &amp;lt;= '2017/05/10',sales,0))+&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;sum(if(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;Yearfield = 2016 AND Datefield &amp;lt;= &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;'2016/05/10',sales,0))+&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;sum(if(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;Yearfield = 2015 AND Datefield &amp;lt;= &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;'2015/05/10',sales,0))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 May 2017 16:17:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-Dates-within-Expression/m-p/1329058#M410797</guid>
      <dc:creator>Sergey_Shuklin</dc:creator>
      <dc:date>2017-05-11T16:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Dates within Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-Dates-within-Expression/m-p/1329059#M410798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for your replies, unfortunately neither resolved my issue&lt;/P&gt;&lt;P&gt;I've tried another example below;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;[Cover]={'1'} &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND &lt;STRONG&gt;(&lt;/STRONG&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ([Financial Year]={"$(v.Date.Current.Year)"},[Transaction Date]={"&amp;lt;=$(v.Date.Yesterday)"})&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;nbsp;&amp;nbsp; OR ([Financial Year]={"$(v.Date.Year.Prior)"},[Transaction Date]={"&amp;lt;=$(v.Date.Date.TodayLastYear)"})&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;nbsp;&amp;nbsp; OR ([Financial Year]={"$(v.Date.Year.Prior2)"},[Transaction Date]={"&amp;lt;=$(v.Date.Date.Today2YearsAgo)"})&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;nbsp; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;}[Quantity Sold])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This would produce a simple chart as in the example below however the example below has the 3 date ranges as separate expressions, I need all 3 as 1 expression as I need to over lay a line graph, which is currently resulting in 3 separate dots rather than a single trend line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="covers graph.jpg" class="jive-image image-1" height="168" src="/legacyfs/online/163338_covers graph.jpg" style="height: 167.763px; width: 273px;" width="273" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 May 2017 08:54:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-Dates-within-Expression/m-p/1329059#M410798</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-15T08:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Dates within Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-Dates-within-Expression/m-p/1329060#M410799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have been able to find the solution '+' is OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For;&lt;/P&gt;&lt;P&gt;(Cover=1 AND Year = Current )&lt;/P&gt;&lt;P&gt;OR (Cover=1 &lt;SPAN style="font-size: 13.3333px;"&gt;AND &lt;/SPAN&gt;Year = Previous AND date &amp;lt;= today last year)&lt;/P&gt;&lt;P&gt;OR &lt;SPAN style="font-size: 13.3333px;"&gt;(Cover=1 &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;AND &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Year = 2 yrs ago AND date &amp;lt;= today 2 yrs ago) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression =;&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;[Cover]={'1'},[Financial Year]={"$(v.Date.Current.Year)"}&amp;gt;&lt;/P&gt;&lt;P&gt;+&amp;lt;[Cover]={'1'} ,[Financial Year]={"$(v.Date.Year.Prior)"},[Transaction Date]={"&amp;lt;=$(v.Date.Date.TodayLastYear)"}&amp;gt;&lt;/P&gt;&lt;P&gt;+&amp;lt;[Cover]={'1'} ,[Financial Year]={"$(v.Date.Year.Prior2)"},[Transaction Date]={"&amp;lt;=$(v.Date.Date.Today2YearsAgo)"}&amp;gt;&lt;/P&gt;&lt;P&gt;}[Quantity Sold])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 May 2017 09:49:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-Dates-within-Expression/m-p/1329060#M410799</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-15T09:49:17Z</dc:date>
    </item>
  </channel>
</rss>

