<?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: Replacing Nulls when Joining two tables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Replacing-Nulls-when-Joining-two-tables/m-p/656347#M674999</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It can be easier to use multiple ApplyMap statements to resolve default values rather than using joins.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can always keep the existing solution on the SQL side of the query.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Aug 2014 15:18:49 GMT</pubDate>
    <dc:creator>Colin-Albert</dc:creator>
    <dc:date>2014-08-11T15:18:49Z</dc:date>
    <item>
      <title>Replacing Nulls when Joining two tables</title>
      <link>https://community.qlik.com/t5/QlikView/Replacing-Nulls-when-Joining-two-tables/m-p/656346#M674998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am wondering if there is an easier/better way to accomplish replacing null values when joining two tables.&amp;nbsp; Here is the situation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a dimension table in the database and I want to apply default values for any null value when applying a mapping table to the dimension table.&amp;nbsp; I need to map several columns so I am not using ApplyMap (although I suppose I could create 5 mapping tables then use them to default the values for each column).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using a SQL Query I would simple join the two tables and use the isnull function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select &lt;/P&gt;&lt;P&gt;BOB_ID&lt;/P&gt;&lt;P&gt;,BOB_DESC&lt;/P&gt;&lt;P&gt;,isnull([Client Name Abr],'New Client') as [Client Name Abr]&lt;/P&gt;&lt;P&gt;,ISNULL([Client Name]), 'New Client') as&amp;nbsp; [Client Name]&lt;/P&gt;&lt;P&gt;FROM "DM_LEDGER"."BLOCK_OF_BUSINESS" d&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Structure s on s.BOB_ID = d.BOB_ID&lt;/P&gt;&lt;P&gt;Where d.LDR_ENTITY_ID = '08304';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having a harder time finding a simple way to pull this off with Qlikview.&amp;nbsp; For now, I am loading the dimension table, then left joining th e structure table, and finally loading into the final table using an IF statement to replace the nulls:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clienttemp:&lt;/P&gt;&lt;P&gt;LOAD "BOB_ID",&lt;/P&gt;&lt;P&gt;&amp;nbsp; "BOB_DESC";&lt;/P&gt;&lt;P&gt;SQL SELECT "BOB_ID",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "BOB_DESC"&lt;/P&gt;&lt;P&gt;FROM "DM_LEDGER"."BLOCK_OF_BUSINESS"&lt;/P&gt;&lt;P&gt;Where LDR_ENTITY_ID = '08304';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ClientStructure:&lt;/P&gt;&lt;P&gt; LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BOB_ID, Client Name Abr, Client Name, PC Owner Abr, PC Owner, ClientSort&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AFAS000004, BBT, BBandT Loan Services, LA, Loe Arr, 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AFAS000037, BSI, BSI, LA, Loe Arr, 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AFAS000012, 5th 3rd, Fifth Third, LA, Loe Arr, 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AFAS000015, HomeS, "Home Servicing, LLC", LA, Loe Arr, 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AFAS000017, Llive, Lender Live, LA, Loe Arr, 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AFAS000021, Ocwen, Ocwen, LA, Loe Arr, 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AFAS000022, OWB, One West Bank, LA, Loe Arr, 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AFAS000025, PMH, PMH Financial, LA, Loe Arr, 1&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join (Clienttemp) Load&lt;/P&gt;&lt;P&gt;BOB_ID, &lt;/P&gt;&lt;P&gt;[Client Name Abr], &lt;/P&gt;&lt;P&gt;[Client Name], &lt;/P&gt;&lt;P&gt;[PC Owner Abr], &lt;/P&gt;&lt;P&gt;[PC Owner], &lt;/P&gt;&lt;P&gt;ClientSort&lt;/P&gt;&lt;P&gt;Resident ClientStructure;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table ClientStructure;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Client:&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt; BOB_ID, BOB_DESC&lt;/P&gt;&lt;P&gt; ,IF(ISNULL([Client Name Abr]),'New Client',[Client Name Abr]) as [Client Name Abr]&lt;/P&gt;&lt;P&gt; ,IF(ISNULL([Client Name]), 'New Client', [Client Name]) as [Client Name]&lt;/P&gt;&lt;P&gt; ,IF(ISNULL([PC Owner Abr]), 'New', [PC Owner Abr]) as [PC Owner Abr]&lt;/P&gt;&lt;P&gt; ,IF(ISNULL([PC Owner]), 'New Client', [PC Owner]) as [PC Owner]&lt;/P&gt;&lt;P&gt; ,IF(ISNULL([ClientSort]), 99, [ClientSort]) as [ClientSort]&lt;/P&gt;&lt;P&gt;Resident Clienttemp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table Clienttemp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there an easier/better way to do this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Aug 2014 15:03:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replacing-Nulls-when-Joining-two-tables/m-p/656346#M674998</guid>
      <dc:creator />
      <dc:date>2014-08-11T15:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing Nulls when Joining two tables</title>
      <link>https://community.qlik.com/t5/QlikView/Replacing-Nulls-when-Joining-two-tables/m-p/656347#M674999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It can be easier to use multiple ApplyMap statements to resolve default values rather than using joins.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can always keep the existing solution on the SQL side of the query.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Aug 2014 15:18:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replacing-Nulls-when-Joining-two-tables/m-p/656347#M674999</guid>
      <dc:creator>Colin-Albert</dc:creator>
      <dc:date>2014-08-11T15:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing Nulls when Joining two tables</title>
      <link>https://community.qlik.com/t5/QlikView/Replacing-Nulls-when-Joining-two-tables/m-p/656348#M675000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Colin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would keep in the SQL side, except the structure table does not exist in the database.&amp;nbsp; I will try using several mapping tables.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Aug 2014 15:25:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replacing-Nulls-when-Joining-two-tables/m-p/656348#M675000</guid>
      <dc:creator />
      <dc:date>2014-08-11T15:25:24Z</dc:date>
    </item>
  </channel>
</rss>

