<?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 Problem with Count( If ( validFrom &amp;lt; CalDate and validTo &amp;gt; CalDate ), CustomerId ) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-Count-If-validFrom-lt-CalDate-and-validTo-gt/m-p/395490#M484425</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My Customer records have validFrom and validTo values that I need to take in account when displaying customer amounts for time period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I set a single day as dimension and Count( If ( validFrom &amp;lt; CalDate and validTo &amp;gt; CalDate), CustomerId ), I get a graph that looks right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I change my dimension to CalFirstDayOfMonth, the results are duplicated by 30, 31 or 28 (365 if I use year as dimension). I know I could use Count ( Distinct ... ), but this slows everything down too much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Calendar-table and Customer-tables are not linked, so why does that if statement produce a hit for each day, instead of just one hit given the dimension being rendered?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 May 2013 12:03:20 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-05-22T12:03:20Z</dc:date>
    <item>
      <title>Problem with Count( If ( validFrom &lt; CalDate and validTo &gt; CalDate ), CustomerId )</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Count-If-validFrom-lt-CalDate-and-validTo-gt/m-p/395490#M484425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My Customer records have validFrom and validTo values that I need to take in account when displaying customer amounts for time period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I set a single day as dimension and Count( If ( validFrom &amp;lt; CalDate and validTo &amp;gt; CalDate), CustomerId ), I get a graph that looks right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I change my dimension to CalFirstDayOfMonth, the results are duplicated by 30, 31 or 28 (365 if I use year as dimension). I know I could use Count ( Distinct ... ), but this slows everything down too much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Calendar-table and Customer-tables are not linked, so why does that if statement produce a hit for each day, instead of just one hit given the dimension being rendered?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2013 12:03:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Count-If-validFrom-lt-CalDate-and-validTo-gt/m-p/395490#M484425</guid>
      <dc:creator />
      <dc:date>2013-05-22T12:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Count( If ( validFrom &lt; CalDate and validTo &gt; CalDate ), CustomerId )</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Count-If-validFrom-lt-CalDate-and-validTo-gt/m-p/395491#M484426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi mlindman ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =Count({&amp;lt;calDate={&amp;lt;validTo&amp;gt;validFrom}&amp;gt;}CustomerId)&lt;/P&gt;&lt;P&gt; I hope it works&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2013 12:14:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Count-If-validFrom-lt-CalDate-and-validTo-gt/m-p/395491#M484426</guid>
      <dc:creator />
      <dc:date>2013-05-22T12:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Count( If ( validFrom &lt; CalDate and validTo &gt; CalDate ), CustomerId )</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Count-If-validFrom-lt-CalDate-and-validTo-gt/m-p/395492#M484427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I changed your suggestion lightly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Count ( { &amp;lt;calDate = { "&amp;lt;validTo&amp;gt;validFrom" }&amp;gt;} CustomerId)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This no longer gives "count hits" for each day of the month, but it doesn't seem to actually check the statement for each month-dimension: I get value of 1 for each month, even though validFrom and validTo should limit it to just certain months.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2013 12:58:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Count-If-validFrom-lt-CalDate-and-validTo-gt/m-p/395492#M484427</guid>
      <dc:creator />
      <dc:date>2013-05-22T12:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Count( If ( validFrom &lt; CalDate and validTo &gt; CalDate ), CustomerId )</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Count-If-validFrom-lt-CalDate-and-validTo-gt/m-p/395493#M484428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems that these suggestions don't actually run the comparison for each dimension value, just once for the whole chart. If I have validFrom 2001-01-01 , validTo 2002-01-01, it will still count for years 2003, 2004 etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2013 13:10:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Count-If-validFrom-lt-CalDate-and-validTo-gt/m-p/395493#M484428</guid>
      <dc:creator />
      <dc:date>2013-05-22T13:10:52Z</dc:date>
    </item>
  </channel>
</rss>

