<?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: Year to date count problem in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Year-to-date-count-problem/m-p/382185#M1167370</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Quick and dirty analysis - the expression routes through to the calender to get to JAAR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Tables offertes has 78400 rows, but only 21824 distinct values of OfferteKey&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The link table has 37984 rows with values of OfferteKey, so some values appear more than once in the link table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because the OfferteKey is not unique in the link table, it will count multiple possible values if you go via the LinkTable to execute the expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another way of structuring your model might have been to concatenate the Orders, Offertes and Invoices table into a single fact table, or if that is not possible, to have separate calendars for each table. If you want to use a link table, then ensure &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Aug 2012 09:34:30 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2012-08-30T09:34:30Z</dc:date>
    <item>
      <title>Year to date count problem</title>
      <link>https://community.qlik.com/t5/QlikView/Year-to-date-count-problem/m-p/382182#M1167367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im having a strange problem consiring a count. &lt;/P&gt;&lt;P&gt;When i do a normal count I get the correct result, when i do a count with an if in i get more then i should have. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Data : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="842"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="94"&gt;offertes.Offline&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="101"&gt;offertes.OffNum&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="82"&gt;OfferteKey&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="152"&gt;offertes.ItemDesc1N&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="113"&gt;offertes.Company&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="99"&gt;offertes.Offdate&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="101"&gt;offertes.Version&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="100"&gt;offertes.Section&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;53&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;77HP Zender&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;REM&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;21-4-2009&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;53&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;77HP Zender&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;REM&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;21-4-2009&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;53&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;77HP Zender&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;REM&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;21-4-2009&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I do :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Count(offertes.Offline) = 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - count( if( offertes.Offdate &amp;lt;= AddMonths(vReloadDate, 12 * (YEAR- year(vReloadDate))), offertes.Offline)) = 6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am aware that there is a MonthToDate function, but I created this before I was aware of that. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If vReloadDate = 01/12/2012, YEAR = 2009&lt;/P&gt;&lt;P&gt;Then this function (AddMonths(vReloadDate, 12 * (YEAR- year(vReloadDate)))) will modify the vReloadDate to 01/12/2012. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I hope someone knows the answer, I'm looking for days for this. &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, 30 Aug 2012 06:08:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Year-to-date-count-problem/m-p/382182#M1167367</guid>
      <dc:creator />
      <dc:date>2012-08-30T06:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Year to date count problem</title>
      <link>https://community.qlik.com/t5/QlikView/Year-to-date-count-problem/m-p/382183#M1167368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming that vReloadDate and YEAR are behaving correctly, then this looks like a model structure issue. The first statement is looking at a single table, but I suspect that offertes.OffDate and/or YEAR are in a table different to offertes.Offline.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then the problem is that the association between the tables is not one to one, so that there may be two rows in the second table for each row in the first. When you incorporate a field from the second table in the expression, it will count the expression for each row in each table, hence 6 in the second count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that does not help, then I suggest that you post your model or a sample so that it can be looked at in more detail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2012 06:35:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Year-to-date-count-problem/m-p/382183#M1167368</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-08-30T06:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: Year to date count problem</title>
      <link>https://community.qlik.com/t5/QlikView/Year-to-date-count-problem/m-p/382184#M1167369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px;"&gt;Hi Jonathan. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px;"&gt;Year is indeed in a different table, but offertes.offdate is not. I added the qvw so you can see for yourself. Maybe there are things I did not mention for you. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px;"&gt;Thank in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2012 06:54:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Year-to-date-count-problem/m-p/382184#M1167369</guid>
      <dc:creator />
      <dc:date>2012-08-30T06:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Year to date count problem</title>
      <link>https://community.qlik.com/t5/QlikView/Year-to-date-count-problem/m-p/382185#M1167370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Quick and dirty analysis - the expression routes through to the calender to get to JAAR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Tables offertes has 78400 rows, but only 21824 distinct values of OfferteKey&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The link table has 37984 rows with values of OfferteKey, so some values appear more than once in the link table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because the OfferteKey is not unique in the link table, it will count multiple possible values if you go via the LinkTable to execute the expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another way of structuring your model might have been to concatenate the Orders, Offertes and Invoices table into a single fact table, or if that is not possible, to have separate calendars for each table. If you want to use a link table, then ensure &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2012 09:34:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Year-to-date-count-problem/m-p/382185#M1167370</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-08-30T09:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: Year to date count problem</title>
      <link>https://community.qlik.com/t5/QlikView/Year-to-date-count-problem/m-p/382186#M1167371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Jonathan, your conclusion was correct indeed. The offerteKey was not unique enough, when adjusting this everything was working properly. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2012 11:18:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Year-to-date-count-problem/m-p/382186#M1167371</guid>
      <dc:creator />
      <dc:date>2012-08-30T11:18:08Z</dc:date>
    </item>
  </channel>
</rss>

