<?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 IsNull, Count and Group by? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/IsNull-Count-and-Group-by/m-p/188052#M51477</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;I am trying to do the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;LOAD&lt;BR /&gt; Value1,&lt;BR /&gt; Count(distinct Timestamp1) AS CountX&lt;BR /&gt;Resident Data123&lt;BR /&gt;Group by Value1;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Timestamp1 sometimes does not exist ('-') and I'd like to have a formula that replace the '-' by a 0.&lt;/P&gt;&lt;P&gt;I was thinking about using an if and IsNull expression, but I always get an "invalid expression" message while running the script. Maybe this is because of the the "Group by"-clause?&lt;/P&gt;&lt;P&gt;I have already tried:&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;if(IsNull(Timestamp1), 0, If(Timestamp1&amp;gt;0, Count (distinct Timestamp1), 0))&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;and as second solution I used the first code above and reload the Data into a new table with the same data plus this:&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;If (IsNull(CountX), '0', CountX) as CountXfinal&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Both solutions do not brought the correct answer yet. In the Layout I still have no results with a 0 but still with '-'.&lt;/P&gt;&lt;P&gt;Maybe there is just a mistake in the code I don't see... Any suggestion?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Dec 2009 21:33:13 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-12-15T21:33:13Z</dc:date>
    <item>
      <title>IsNull, Count and Group by?</title>
      <link>https://community.qlik.com/t5/QlikView/IsNull-Count-and-Group-by/m-p/188052#M51477</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;I am trying to do the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;LOAD&lt;BR /&gt; Value1,&lt;BR /&gt; Count(distinct Timestamp1) AS CountX&lt;BR /&gt;Resident Data123&lt;BR /&gt;Group by Value1;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Timestamp1 sometimes does not exist ('-') and I'd like to have a formula that replace the '-' by a 0.&lt;/P&gt;&lt;P&gt;I was thinking about using an if and IsNull expression, but I always get an "invalid expression" message while running the script. Maybe this is because of the the "Group by"-clause?&lt;/P&gt;&lt;P&gt;I have already tried:&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;if(IsNull(Timestamp1), 0, If(Timestamp1&amp;gt;0, Count (distinct Timestamp1), 0))&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;and as second solution I used the first code above and reload the Data into a new table with the same data plus this:&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;If (IsNull(CountX), '0', CountX) as CountXfinal&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Both solutions do not brought the correct answer yet. In the Layout I still have no results with a 0 but still with '-'.&lt;/P&gt;&lt;P&gt;Maybe there is just a mistake in the code I don't see... Any suggestion?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Dec 2009 21:33:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IsNull-Count-and-Group-by/m-p/188052#M51477</guid>
      <dc:creator />
      <dc:date>2009-12-15T21:33:13Z</dc:date>
    </item>
    <item>
      <title>IsNull, Count and Group by?</title>
      <link>https://community.qlik.com/t5/QlikView/IsNull-Count-and-Group-by/m-p/188053#M51478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;GROUP BY is expecting aggregation, so count must be first:&lt;/P&gt;&lt;P&gt;COUNT(DISTINCT IF( ISNULL(Timestamp1), 0, Timestamp1) )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2009 01:32:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IsNull-Count-and-Group-by/m-p/188053#M51478</guid>
      <dc:creator />
      <dc:date>2009-12-16T01:32:00Z</dc:date>
    </item>
  </channel>
</rss>

