<?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: Count with date limitation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-with-date-limitation/m-p/488089#M182383</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your quick reply. A couple of questions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- is "makedate" a variable that is created by this code?&lt;/P&gt;&lt;P&gt;- if I understand correctly, "Date" in your code above is using system date? What if I want to change that to another date field in my data? for example purchase_date&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Sep 2013 14:49:25 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-09-05T14:49:25Z</dc:date>
    <item>
      <title>Count with date limitation</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-date-limitation/m-p/488087#M182381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am a new QV user and sttempting to do the following - count the number of distinct clients within 1 year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got the first part done by using this expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count(distinct CUSTOMER_ID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I now also add a date range to the above expression? For example between Jan 1 2012 to Jan 1 2013?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Sep 2013 14:32:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-date-limitation/m-p/488087#M182381</guid>
      <dc:creator />
      <dc:date>2013-09-05T14:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: Count with date limitation</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-date-limitation/m-p/488088#M182382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;=count(distinct if(Date &amp;gt;= makedate(2012) and Date &amp;lt;= makedate(2013),CUSTOMER_ID))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or using set analysis:&lt;/P&gt;&lt;P&gt;=count({&amp;lt;Date = {"&amp;gt;=$(=makedate(2012))&amp;lt;=$(=makedate(2013))"}&amp;gt;} distinct CUSTOMER_ID)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Sep 2013 14:40:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-date-limitation/m-p/488088#M182382</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-09-05T14:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: Count with date limitation</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-date-limitation/m-p/488089#M182383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your quick reply. A couple of questions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- is "makedate" a variable that is created by this code?&lt;/P&gt;&lt;P&gt;- if I understand correctly, "Date" in your code above is using system date? What if I want to change that to another date field in my data? for example purchase_date&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Sep 2013 14:49:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-date-limitation/m-p/488089#M182383</guid>
      <dc:creator />
      <dc:date>2013-09-05T14:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: Count with date limitation</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-date-limitation/m-p/488090#M182384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Date in my example is your Date field, you can replace it with your field purchase_date:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=count(distinct if(purchase_date&amp;gt;= makedate(2012) and purchase_date &amp;lt;= makedate(2013),CUSTOMER_ID))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;makedate() is a QV function that creates a date value on the fly, using the function arguments (check the Help for more on makedate() function). In the second example, I use a dollar sign expansion with an expression (also check the Help for that topic) to replace this with the date value (like a macro expansion, the date value is evaluated and replaced within the expression string before its evaluated).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Sep 2013 14:59:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-date-limitation/m-p/488090#M182384</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-09-05T14:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: Count with date limitation</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-date-limitation/m-p/488091#M182385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot for your explanation and help! I will experiment further now!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Sep 2013 16:59:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-date-limitation/m-p/488091#M182385</guid>
      <dc:creator />
      <dc:date>2013-09-05T16:59:24Z</dc:date>
    </item>
  </channel>
</rss>

