<?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: Counting based on particular date. in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Counting-based-on-particular-date/m-p/1798664#M64657</link>
    <description>&lt;P&gt;This still won't work correctly, I think - it'll work if the date field is a single value and you just need to pick a count formula, but it won't work if you have multiple rows with dates that may be older or newer than the value. In that scenario, the if() statement needs to be inside the count, or you need two count statements added together.&lt;/P&gt;&lt;P&gt;Two count version would look something like this - can't test the syntax:&lt;BR /&gt;count({&amp;lt;filter1 ={'1'},filter2 = {'a'}&amp;gt;} If(Date(date_field) &amp;lt;= MakeDate(2021,03,15),filter2))&lt;/P&gt;&lt;P&gt;+&lt;BR /&gt;count({&amp;lt;filter1 ={'2'},filter2 = {'a'}&amp;gt;} If(Date(date_field) &amp;gt; MakeDate(2021,03,15),filter2))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The other approach would be to put the date_field condition inside the set analysis, which is a little more tricky to write out without the actual dataset so I'm not going to attempt it in a text editor, but I'm sure someone can supply the specific syntax.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Apr 2021 08:48:06 GMT</pubDate>
    <dc:creator>Or</dc:creator>
    <dc:date>2021-04-12T08:48:06Z</dc:date>
    <item>
      <title>Counting based on particular date.</title>
      <link>https://community.qlik.com/t5/App-Development/Counting-based-on-particular-date/m-p/1798648#M64652</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;I am trying to write an expression with date condition.&lt;BR /&gt;When the date &amp;lt;= '3/15/2021' the count will be based on&amp;nbsp;&amp;nbsp;filter1 = {'1'} and filter2 = {'a'}&lt;span class="lia-inline-image-display-wrapper lia-image-align-right" image-alt="Qliksense_example.PNG" style="width: 184px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/52784i81B8904A8EAC4BC4/image-dimensions/184x174?v=v2" width="184" height="174" role="button" title="Qliksense_example.PNG" alt="Qliksense_example.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and if the date &amp;gt; '3/15/2021' the count will be based on&amp;nbsp;filter1 = {'2'} and filter2 = {'a'}.&lt;/P&gt;&lt;P&gt;My output should be :&amp;nbsp;&lt;/P&gt;&lt;P&gt;For&amp;nbsp;3/15/2021 the count is 2 and for&amp;nbsp;3/29/2021 the count is 3.&lt;/P&gt;&lt;P&gt;I tried with the following expression , but its failing with the "&lt;EM&gt;Error in Expression ')' expected&lt;/EM&gt;"&lt;/P&gt;&lt;P&gt;=If(date = ("&amp;lt;=3/15/2021"),&lt;BR /&gt;count({&amp;lt;filter1 ={'1'},filter2 = {'a'}&amp;gt;} filter2),&lt;BR /&gt;count({&amp;lt;filter1 ={'2'},filter2 = {'a'}&amp;gt;}filter2))&lt;/P&gt;&lt;P&gt;I'd appreciate if I could get the best method/syntax to produce this result?&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 08:06:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Counting-based-on-particular-date/m-p/1798648#M64652</guid>
      <dc:creator>AJ1806</dc:creator>
      <dc:date>2021-04-12T08:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: Counting based on particular date.</title>
      <link>https://community.qlik.com/t5/App-Development/Counting-based-on-particular-date/m-p/1798651#M64654</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;If(Date(date_field) &amp;lt;= MakeDate(2021,03,15),
count({&amp;lt;filter1 ={'1'},filter2 = {'a'}&amp;gt;} filter2),
count({&amp;lt;filter1 ={'2'},filter2 = {'a'}&amp;gt;} filter2))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;make sure your date field is in correct date format.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 08:27:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Counting-based-on-particular-date/m-p/1798651#M64654</guid>
      <dc:creator>Quy_Nguyen</dc:creator>
      <dc:date>2021-04-12T08:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Counting based on particular date.</title>
      <link>https://community.qlik.com/t5/App-Development/Counting-based-on-particular-date/m-p/1798664#M64657</link>
      <description>&lt;P&gt;This still won't work correctly, I think - it'll work if the date field is a single value and you just need to pick a count formula, but it won't work if you have multiple rows with dates that may be older or newer than the value. In that scenario, the if() statement needs to be inside the count, or you need two count statements added together.&lt;/P&gt;&lt;P&gt;Two count version would look something like this - can't test the syntax:&lt;BR /&gt;count({&amp;lt;filter1 ={'1'},filter2 = {'a'}&amp;gt;} If(Date(date_field) &amp;lt;= MakeDate(2021,03,15),filter2))&lt;/P&gt;&lt;P&gt;+&lt;BR /&gt;count({&amp;lt;filter1 ={'2'},filter2 = {'a'}&amp;gt;} If(Date(date_field) &amp;gt; MakeDate(2021,03,15),filter2))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The other approach would be to put the date_field condition inside the set analysis, which is a little more tricky to write out without the actual dataset so I'm not going to attempt it in a text editor, but I'm sure someone can supply the specific syntax.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 08:48:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Counting-based-on-particular-date/m-p/1798664#M64657</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-04-12T08:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Counting based on particular date.</title>
      <link>https://community.qlik.com/t5/App-Development/Counting-based-on-particular-date/m-p/1798684#M64662</link>
      <description>&lt;P&gt;You're right. I was just thinking about correct his expression to show it in a table with single date value. Your suggestion is better, it works for all cases.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 09:27:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Counting-based-on-particular-date/m-p/1798684#M64662</guid>
      <dc:creator>Quy_Nguyen</dc:creator>
      <dc:date>2021-04-12T09:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: Counting based on particular date.</title>
      <link>https://community.qlik.com/t5/App-Development/Counting-based-on-particular-date/m-p/1798692#M64663</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;SPAN&gt;Quy_Nguyen,&lt;BR /&gt;This expression is working for me , thank you!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 09:40:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Counting-based-on-particular-date/m-p/1798692#M64663</guid>
      <dc:creator>AJ1806</dc:creator>
      <dc:date>2021-04-12T09:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: Counting based on particular date.</title>
      <link>https://community.qlik.com/t5/App-Development/Counting-based-on-particular-date/m-p/1798700#M64666</link>
      <description>&lt;P&gt;Hello Or,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Yes, I have many dates which are older and newer than 15th of March. But this date is the threshold for the analysis.&lt;/P&gt;&lt;P&gt;I shall try the sum of the two count expression also.&lt;BR /&gt;Thank you !&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 09:52:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Counting-based-on-particular-date/m-p/1798700#M64666</guid>
      <dc:creator>AJ1806</dc:creator>
      <dc:date>2021-04-12T09:52:01Z</dc:date>
    </item>
  </channel>
</rss>

