<?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: do not trust nullasvalue in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/do-not-trust-nullasvalue/m-p/114225#M602799</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's also possible to map nulls to a default value instead. It works for nulls created from concatenations and joins.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ZeroDefault:&lt;/P&gt;&lt;P&gt;Mapping Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Null(), 0&lt;/P&gt;&lt;P&gt;Autogenerate 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Map SalesOtherMetric Using ZeroDefault;&lt;/P&gt;&lt;P&gt;Map SalesMetric Using ZeroDefault;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then load your data after (non-optimized if from qvd).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Oct 2018 22:03:19 GMT</pubDate>
    <dc:creator>mikevwang</dc:creator>
    <dc:date>2018-10-17T22:03:19Z</dc:date>
    <item>
      <title>do not trust nullasvalue</title>
      <link>https://community.qlik.com/t5/QlikView/do-not-trust-nullasvalue/m-p/114224#M602798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This post is a tip to avoid a lot of frustration.&amp;nbsp; In all but the simplest of qlik views, we all use concatenated facts.&amp;nbsp; nullasvalue DOES NOT handle setting values across concatenated facts in which some columns exist in one data set and not another.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fact_main:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;SalesMetric&amp;nbsp; exists only in the first data set&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate (Fact_Main)&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SalesOtherMetric&amp;nbsp; exists only in the second data set&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;defining nullasvalue on both of these columns to 0, up front prior to the load does not set them to 0 when data loads for columns that do not exists accross data sets.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;So a measure defined as sum(SalesMetric + SalesOtherMetric)&amp;nbsp; will compute to 0 (bad),&amp;nbsp; since nullasvalue "does not work" as you might think.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Best to avoid ever using nullasvalue, and explicitly set columns that do not exist in each others dataset to 0, or whatever value they need.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Ex.&amp;nbsp; The best practice way:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;fact_main:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Load&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;SalesMetric&amp;nbsp; exists only in the first data set&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;0 as SalesOtherMetric&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;...&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;concatenate (Fct_Main)&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Load&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SalesOtherMetric&amp;nbsp; exists only in the second data set&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;0 as SalesMetric&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;...&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Now, &lt;SPAN style="font-size: 13.3333px;"&gt; sum(SalesMetric + SalesOtherMetric)&amp;nbsp; will compute properly.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Oct 2018 21:03:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/do-not-trust-nullasvalue/m-p/114224#M602798</guid>
      <dc:creator>dadumas</dc:creator>
      <dc:date>2018-10-17T21:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: do not trust nullasvalue</title>
      <link>https://community.qlik.com/t5/QlikView/do-not-trust-nullasvalue/m-p/114225#M602799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's also possible to map nulls to a default value instead. It works for nulls created from concatenations and joins.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ZeroDefault:&lt;/P&gt;&lt;P&gt;Mapping Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Null(), 0&lt;/P&gt;&lt;P&gt;Autogenerate 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Map SalesOtherMetric Using ZeroDefault;&lt;/P&gt;&lt;P&gt;Map SalesMetric Using ZeroDefault;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then load your data after (non-optimized if from qvd).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Oct 2018 22:03:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/do-not-trust-nullasvalue/m-p/114225#M602799</guid>
      <dc:creator>mikevwang</dc:creator>
      <dc:date>2018-10-17T22:03:19Z</dc:date>
    </item>
  </channel>
</rss>

