<?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 Reporting Date counting records multiple times in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Reporting-Date-counting-records-multiple-times/m-p/1793235#M62100</link>
    <description>&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;I have created following expression to get a count of invoices -&amp;nbsp;&lt;/P&gt;&lt;P&gt;COUNT(&lt;BR /&gt;IF ( ([ Invoice Date]) &amp;lt;= EOMDate,&lt;BR /&gt;[Invoice Number]))&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;EOMDate is a reporting variable i.e. end of month for last 12 months to plot a graph.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see that each invoice is counted as many times as the number of days in the month. Can anyone please suggest why it is counting in this manner. I don't want to use distinct as I do have same invoice number from different supplier in database.&lt;/P&gt;&lt;P&gt;EOMDate created using following script -&lt;/P&gt;&lt;P&gt;Let varMinDate = Num(Makedate(Year(Today())-2,Month(Today()),Day(Today())));&lt;BR /&gt;Let varMaxDate = Num(Makedate(Year(today()),Month(Today()),Day(Today())));Datefield:&lt;BR /&gt;LOAD MonthEnd(date($(varMinDate)+IterNo()-1)) AS Datefield&lt;BR /&gt;AUTOGENERATE (1)&lt;BR /&gt;WHILE $(varMinDate)+IterNo()-1&amp;lt;= $(varMaxDate);Calender:&lt;BR /&gt;LOAD&lt;BR /&gt;Date(Datefield) AS EOMDate,&lt;BR /&gt;Year(Datefield) AS RepYear,&lt;BR /&gt;Month(Datefield) As RepMonth,&lt;BR /&gt;Day(Datefield) AS RepDay,&lt;BR /&gt;'Q ' &amp;amp; Num(Ceil(Month(Datefield)/3),'(ROM)0') AS RepQuarter&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;</description>
    <pubDate>Thu, 01 Apr 2021 13:46:08 GMT</pubDate>
    <dc:creator>SR2</dc:creator>
    <dc:date>2021-04-01T13:46:08Z</dc:date>
    <item>
      <title>Reporting Date counting records multiple times</title>
      <link>https://community.qlik.com/t5/App-Development/Reporting-Date-counting-records-multiple-times/m-p/1793235#M62100</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;I have created following expression to get a count of invoices -&amp;nbsp;&lt;/P&gt;&lt;P&gt;COUNT(&lt;BR /&gt;IF ( ([ Invoice Date]) &amp;lt;= EOMDate,&lt;BR /&gt;[Invoice Number]))&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;EOMDate is a reporting variable i.e. end of month for last 12 months to plot a graph.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see that each invoice is counted as many times as the number of days in the month. Can anyone please suggest why it is counting in this manner. I don't want to use distinct as I do have same invoice number from different supplier in database.&lt;/P&gt;&lt;P&gt;EOMDate created using following script -&lt;/P&gt;&lt;P&gt;Let varMinDate = Num(Makedate(Year(Today())-2,Month(Today()),Day(Today())));&lt;BR /&gt;Let varMaxDate = Num(Makedate(Year(today()),Month(Today()),Day(Today())));Datefield:&lt;BR /&gt;LOAD MonthEnd(date($(varMinDate)+IterNo()-1)) AS Datefield&lt;BR /&gt;AUTOGENERATE (1)&lt;BR /&gt;WHILE $(varMinDate)+IterNo()-1&amp;lt;= $(varMaxDate);Calender:&lt;BR /&gt;LOAD&lt;BR /&gt;Date(Datefield) AS EOMDate,&lt;BR /&gt;Year(Datefield) AS RepYear,&lt;BR /&gt;Month(Datefield) As RepMonth,&lt;BR /&gt;Day(Datefield) AS RepDay,&lt;BR /&gt;'Q ' &amp;amp; Num(Ceil(Month(Datefield)/3),'(ROM)0') AS RepQuarter&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Apr 2021 13:46:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Reporting-Date-counting-records-multiple-times/m-p/1793235#M62100</guid>
      <dc:creator>SR2</dc:creator>
      <dc:date>2021-04-01T13:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: Reporting Date counting records multiple times</title>
      <link>https://community.qlik.com/t5/App-Development/Reporting-Date-counting-records-multiple-times/m-p/1793507#M62133</link>
      <description>&lt;P&gt;Check that your table keys are correct between the invoice table and the calendar table. When count() fails to return the expected result, that's the first place to look. If your keys appear to be correct, try a simple count([Invoice Number]) while selecting the required date range and see if that gets the correct result - if it does, the issue is likely with the if() statement. If it does not, the issue is probably with the underlying data structure or data.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 20:13:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Reporting-Date-counting-records-multiple-times/m-p/1793507#M62133</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-03-22T20:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: Reporting Date counting records multiple times</title>
      <link>https://community.qlik.com/t5/App-Development/Reporting-Date-counting-records-multiple-times/m-p/1793569#M62144</link>
      <description>&lt;P&gt;Thank you for your reply. I did not join the calendar table with the invoice table. I will join and see if that resolves the issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Tue, 23 Mar 2021 06:10:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Reporting-Date-counting-records-multiple-times/m-p/1793569#M62144</guid>
      <dc:creator>SR2</dc:creator>
      <dc:date>2021-03-23T06:10:09Z</dc:date>
    </item>
  </channel>
</rss>

