<?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 Help With Table Joins and Mapping Null Fields in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-With-Table-Joins-and-Mapping-Null-Fields/m-p/821173#M667492</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to accomplish something that is very simple with SQL Server.&amp;nbsp; I have two tables that I want to join, and I want to default values when they don't exist in the second table.&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;SELECT&lt;/P&gt;&lt;P&gt;c.COST_CENTER_ID, &lt;/P&gt;&lt;P&gt;ISNULL(m.[Cost Center], 'Other') AS [Cost Center], &lt;/P&gt;&lt;P&gt;ISNULL(m.[Sub Cost Center],COST_CENTER_DESC) AS&amp;nbsp; [Sub Cost Center],&lt;/P&gt;&lt;P&gt;c.COST_CENTER_DESC&lt;/P&gt;&lt;P&gt;FROM CostCenter c&lt;/P&gt;&lt;P&gt;&amp;nbsp; LEFT OUTER JOIN CC_Map m ON c.COST_CENTER_ID = m.COST_CENTER_ID;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have found a work around in Qlikview to get this result, but it seems really awkward and cumbersome.&amp;nbsp; I was hoping someone could show me a better way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NullMapCC:&lt;/P&gt;&lt;P&gt;MAPPING LOAD null(), 'Other' AUTOGENERATE 1;&lt;/P&gt;&lt;P&gt;MAP [Cost Center] USING NullMapCC;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CostCenter:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; COST_CENTER_ID, COST_CENTER_DESC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46258, AFAS INSPECTIONS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46266, AFAS PROPERTY PRESERVATION&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46254, AFAS REHAB&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46256, AFAS HOA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46255, AFAS REGISTRATIONS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46264, AFAS RELOCATIONS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46265, AFAS UTILITIES&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46253, AFAS EXECUTIVE MANAGEMENT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46259, AFAS FINANCE AND ACCOUNTING&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join (CostCenter)&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; COST_CENTER_ID, Cost Center, Sub Cost Center&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46258, Inspections, Inspections&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46266, Property Preservation, Property Preservation&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46254, Rehab, Rehab&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46256, Ancilary Services, HOA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46255, Ancilary Services, Registrations&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46264, Ancilary Services, Relocations&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46265, Ancilary Services, Utilities&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CostCenter2:&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;Load *&lt;/P&gt;&lt;P&gt;Resident CostCenter;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table CostCenter;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CostCenter:&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;COST_CENTER_ID, &lt;/P&gt;&lt;P&gt;[Cost Center], &lt;/P&gt;&lt;P&gt;IF([Cost Center]='Other', COST_CENTER_DESC, [Sub Cost Center]) as [Sub Cost Center],&lt;/P&gt;&lt;P&gt;COST_CENTER_DESC&lt;/P&gt;&lt;P&gt;Resident CostCenter2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table CostCenter2;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Nov 2014 17:26:38 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-11-12T17:26:38Z</dc:date>
    <item>
      <title>Help With Table Joins and Mapping Null Fields</title>
      <link>https://community.qlik.com/t5/QlikView/Help-With-Table-Joins-and-Mapping-Null-Fields/m-p/821173#M667492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to accomplish something that is very simple with SQL Server.&amp;nbsp; I have two tables that I want to join, and I want to default values when they don't exist in the second table.&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;SELECT&lt;/P&gt;&lt;P&gt;c.COST_CENTER_ID, &lt;/P&gt;&lt;P&gt;ISNULL(m.[Cost Center], 'Other') AS [Cost Center], &lt;/P&gt;&lt;P&gt;ISNULL(m.[Sub Cost Center],COST_CENTER_DESC) AS&amp;nbsp; [Sub Cost Center],&lt;/P&gt;&lt;P&gt;c.COST_CENTER_DESC&lt;/P&gt;&lt;P&gt;FROM CostCenter c&lt;/P&gt;&lt;P&gt;&amp;nbsp; LEFT OUTER JOIN CC_Map m ON c.COST_CENTER_ID = m.COST_CENTER_ID;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have found a work around in Qlikview to get this result, but it seems really awkward and cumbersome.&amp;nbsp; I was hoping someone could show me a better way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NullMapCC:&lt;/P&gt;&lt;P&gt;MAPPING LOAD null(), 'Other' AUTOGENERATE 1;&lt;/P&gt;&lt;P&gt;MAP [Cost Center] USING NullMapCC;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CostCenter:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; COST_CENTER_ID, COST_CENTER_DESC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46258, AFAS INSPECTIONS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46266, AFAS PROPERTY PRESERVATION&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46254, AFAS REHAB&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46256, AFAS HOA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46255, AFAS REGISTRATIONS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46264, AFAS RELOCATIONS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46265, AFAS UTILITIES&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46253, AFAS EXECUTIVE MANAGEMENT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46259, AFAS FINANCE AND ACCOUNTING&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join (CostCenter)&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; COST_CENTER_ID, Cost Center, Sub Cost Center&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46258, Inspections, Inspections&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46266, Property Preservation, Property Preservation&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46254, Rehab, Rehab&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46256, Ancilary Services, HOA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46255, Ancilary Services, Registrations&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46264, Ancilary Services, Relocations&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46265, Ancilary Services, Utilities&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CostCenter2:&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;Load *&lt;/P&gt;&lt;P&gt;Resident CostCenter;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table CostCenter;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CostCenter:&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;COST_CENTER_ID, &lt;/P&gt;&lt;P&gt;[Cost Center], &lt;/P&gt;&lt;P&gt;IF([Cost Center]='Other', COST_CENTER_DESC, [Sub Cost Center]) as [Sub Cost Center],&lt;/P&gt;&lt;P&gt;COST_CENTER_DESC&lt;/P&gt;&lt;P&gt;Resident CostCenter2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table CostCenter2;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2014 17:26:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-With-Table-Joins-and-Mapping-Null-Fields/m-p/821173#M667492</guid>
      <dc:creator />
      <dc:date>2014-11-12T17:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: Help With Table Joins and Mapping Null Fields</title>
      <link>https://community.qlik.com/t5/QlikView/Help-With-Table-Joins-and-Mapping-Null-Fields/m-p/821174#M667493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See attached qvw,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2014 17:45:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-With-Table-Joins-and-Mapping-Null-Fields/m-p/821174#M667493</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-11-12T17:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Help With Table Joins and Mapping Null Fields</title>
      <link>https://community.qlik.com/t5/QlikView/Help-With-Table-Joins-and-Mapping-Null-Fields/m-p/821175#M667494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Very nice, thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How does if(len(trim([Cost Center])),[Cost Center], 'Other') evaluate? if the field is null it returns false?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2014 18:26:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-With-Table-Joins-and-Mapping-Null-Fields/m-p/821175#M667494</guid>
      <dc:creator />
      <dc:date>2014-11-12T18:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: Help With Table Joins and Mapping Null Fields</title>
      <link>https://community.qlik.com/t5/QlikView/Help-With-Table-Joins-and-Mapping-Null-Fields/m-p/821176#M667495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that's correct. If the value of a field is null or contains only spaces then the length of the value after applying the trim function will be zero. And zero is the value for 'false'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2014 18:49:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-With-Table-Joins-and-Mapping-Null-Fields/m-p/821176#M667495</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-11-12T18:49:57Z</dc:date>
    </item>
  </channel>
</rss>

