<?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: Comparison between date range using variables cross years in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Comparison-between-date-range-using-variables-cross-years/m-p/127740#M8947</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Marcello. You can add a field to the calendar like this&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Num(Month(Date)) &amp;amp; Num(Day(Date), '00')&amp;nbsp; as [MonthDay]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and the statement would be&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;Count({$&amp;lt;[&lt;STRONG style="font-size: 13.3333330154419px;"&gt;[MonthDay] &lt;/STRONG&gt;={"&amp;gt;=$(=Date(StartDate&lt;SPAN style="font-size: 13.3333330154419px;"&gt;, 'MDD'&lt;/SPAN&gt;))&amp;lt;=$(=Date(EndDate&lt;SPAN style="font-size: 13.3333330154419px;"&gt;, 'MDD'&lt;/SPAN&gt;))"}, &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;[DataDoc.autoCalendar.Date], &lt;/SPAN&gt;[DataDoc.autoCalendar.Year]&amp;gt;} distinct [CustomerCode])&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Sep 2018 18:07:03 GMT</pubDate>
    <dc:creator>andrey_krylov</dc:creator>
    <dc:date>2018-09-14T18:07:03Z</dc:date>
    <item>
      <title>Comparison between date range using variables cross years</title>
      <link>https://community.qlik.com/t5/App-Development/Comparison-between-date-range-using-variables-cross-years/m-p/127739#M8946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;i'm trying to calculate the numbers of customers between two dates ( two dates of one year) and compare the same period in the past years.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the following statement I have the number of customers between the two dates but not in the others years. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count({$&amp;lt;[DataDoc.autoCalendar.Date]={"&amp;gt;=$(=Date(StartDate))&amp;lt;=$(=Date(EndDate))"}&amp;gt;} distinct [CustomerCode])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count({$&amp;lt;[DataDoc.autoCalendar.Date]={"&amp;gt;=$(=Date(StartDate))&amp;lt;=$(=Date(EndDate))"}&amp;gt;+1&amp;lt;[DataDoc.autoCalendar.Year]=&amp;gt;} distinct [CustomerCode])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it doesn't work because it return all dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could use the function AddYears() but I don't wont write n times the same statement...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count({$&amp;lt;[DataDoc.autoCalendar.Date]={"&amp;gt;=$(=AddYears(Date(StartDate)),-1)&amp;lt;=$(=AddYears(Date(EndDate)),-1)"}&amp;gt;} distinct [CustomerCode])&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;Count({$&amp;lt;[DataDoc.autoCalendar.Date]={"&amp;gt;=$(=AddYears(Date(StartDate)),-2)&amp;lt;=$(=AddYears(Date(EndDate)),-2)"}&amp;gt;} distinct [CustomerCode])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and so on....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm sure it's more easy....any suggest?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2018 11:45:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Comparison-between-date-range-using-variables-cross-years/m-p/127739#M8946</guid>
      <dc:creator>marcello_castor</dc:creator>
      <dc:date>2018-09-14T11:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: Comparison between date range using variables cross years</title>
      <link>https://community.qlik.com/t5/App-Development/Comparison-between-date-range-using-variables-cross-years/m-p/127740#M8947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Marcello. You can add a field to the calendar like this&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Num(Month(Date)) &amp;amp; Num(Day(Date), '00')&amp;nbsp; as [MonthDay]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and the statement would be&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;Count({$&amp;lt;[&lt;STRONG style="font-size: 13.3333330154419px;"&gt;[MonthDay] &lt;/STRONG&gt;={"&amp;gt;=$(=Date(StartDate&lt;SPAN style="font-size: 13.3333330154419px;"&gt;, 'MDD'&lt;/SPAN&gt;))&amp;lt;=$(=Date(EndDate&lt;SPAN style="font-size: 13.3333330154419px;"&gt;, 'MDD'&lt;/SPAN&gt;))"}, &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;[DataDoc.autoCalendar.Date], &lt;/SPAN&gt;[DataDoc.autoCalendar.Year]&amp;gt;} distinct [CustomerCode])&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2018 18:07:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Comparison-between-date-range-using-variables-cross-years/m-p/127740#M8947</guid>
      <dc:creator>andrey_krylov</dc:creator>
      <dc:date>2018-09-14T18:07:03Z</dc:date>
    </item>
  </channel>
</rss>

