<?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 Pie Chart ignoring Null values in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Pie-Chart-ignoring-Null-values/m-p/1735243#M56173</link>
    <description>&lt;P&gt;I am creating a pie chart to show the share of a population that is either Male or Female.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The breakdown is 23.03% female, 42.16% male and 34.81% null.&lt;/P&gt;&lt;P&gt;When I create the pie chart, I use ' Gender' as the dimension and =count(acctid) as the measure. When I do this, the values above show correctly, however I do not want to include nulls. When I un-select 'Include Null Values' under the dimension, the Null values go away, however the percentages are then inflated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I correct this?&lt;/P&gt;</description>
    <pubDate>Wed, 12 Aug 2020 13:05:58 GMT</pubDate>
    <dc:creator>evansabres</dc:creator>
    <dc:date>2020-08-12T13:05:58Z</dc:date>
    <item>
      <title>Pie Chart ignoring Null values</title>
      <link>https://community.qlik.com/t5/App-Development/Pie-Chart-ignoring-Null-values/m-p/1735243#M56173</link>
      <description>&lt;P&gt;I am creating a pie chart to show the share of a population that is either Male or Female.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The breakdown is 23.03% female, 42.16% male and 34.81% null.&lt;/P&gt;&lt;P&gt;When I create the pie chart, I use ' Gender' as the dimension and =count(acctid) as the measure. When I do this, the values above show correctly, however I do not want to include nulls. When I un-select 'Include Null Values' under the dimension, the Null values go away, however the percentages are then inflated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I correct this?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 13:05:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Pie-Chart-ignoring-Null-values/m-p/1735243#M56173</guid>
      <dc:creator>evansabres</dc:creator>
      <dc:date>2020-08-12T13:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: Pie Chart ignoring Null values</title>
      <link>https://community.qlik.com/t5/App-Development/Pie-Chart-ignoring-Null-values/m-p/1735509#M56194</link>
      <description>&lt;P&gt;On a pie chart the wedges must&amp;nbsp;&lt;STRONG&gt;always&lt;/STRONG&gt; total to 100%, so a pie chart with two wedges that total 65% is not a valid visualisation.&lt;/P&gt;&lt;P&gt;Your best bet is to replace the null values with 'Not specified' or similar. You can do this in the load script:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LOAD
   if(IsNull(Gender), 'Not Specified', Gender) as Gender,
   etc.&lt;/LI-CODE&gt;&lt;P&gt;It's always a good idea to replace nulls in the load script, as they can throw out calculations.&lt;/P&gt;&lt;P&gt;Also, it's a good idea to add a counter to your load (&lt;STRONG&gt;1 as PopCount,&lt;/STRONG&gt;) so you can do sum type calculations (&lt;STRONG&gt;sum(PopCount)&lt;/STRONG&gt;) rather than count expressions, as these are more efficient.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 09:05:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Pie-Chart-ignoring-Null-values/m-p/1735509#M56194</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2020-08-13T09:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Pie Chart ignoring Null values</title>
      <link>https://community.qlik.com/t5/App-Development/Pie-Chart-ignoring-Null-values/m-p/1735680#M56205</link>
      <description>&lt;P&gt;Thank you,understood on the pie chart. Can you please elaborate on the PopCount expression?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 15:36:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Pie-Chart-ignoring-Null-values/m-p/1735680#M56205</guid>
      <dc:creator>evansabres</dc:creator>
      <dc:date>2020-08-13T15:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: Pie Chart ignoring Null values</title>
      <link>https://community.qlik.com/t5/App-Development/Pie-Chart-ignoring-Null-values/m-p/1735767#M56222</link>
      <description>&lt;P&gt;It's an "under the bonnet" consideration. If the engine does a count it has to look at every value in a virtual table containing every acctid, looking to see if it is null or not and then counting them. If you have the number 1 on every row it will create a virtual table with only the number 1 in and it will keep tabs of how many there are. Adding up those 1s is then much quicker.&lt;/P&gt;&lt;P&gt;The code to do this will be:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LOAD
   1 as PopCount,
   acctid,
   if(IsNull(Gender), 'Not Known', Gender) as Gender,
   if(IsNull(Gender), 0, 1) as GenderKnown,
   ... rest of load ...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see, you can also have other binary flags, which can be used for set analysis or other purposes.&lt;/P&gt;&lt;P&gt;For example if you wanted to know the proportion of Male or Female when you have a value you could do&amp;nbsp;&lt;STRONG&gt;sum(GenderKnown)&amp;nbsp;&lt;/STRONG&gt;or for the whole cohort you could use&amp;nbsp;&lt;STRONG&gt;sum(PopCount)&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Hope that makes sense?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 19:59:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Pie-Chart-ignoring-Null-values/m-p/1735767#M56222</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2020-08-13T19:59:05Z</dc:date>
    </item>
  </channel>
</rss>

