<?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: Mapping/Handling Null or Empty Value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Mapping-Handling-Null-or-Empty-Value/m-p/1635994#M446793</link>
    <description>&lt;P&gt;the scenario you have generates empty value and not null, if you want to handle it as null you need to join these tables&lt;/P&gt;&lt;P&gt;and apply transformation on top it for example&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;joinedTbl:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Name,&lt;/P&gt;&lt;P&gt;Location,&lt;/P&gt;&lt;P&gt;Supplier,&lt;/P&gt;&lt;P&gt;FROM [file](qvd);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;outer join&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;IF(LEN(TRIM(PurgeChar(Dept,'-0123456789')))&amp;gt;1,TRIM(PurgeChar(Dept,'-0123456789'))) AS Department,&lt;/P&gt;&lt;P&gt;Name,&lt;/P&gt;&lt;P&gt;Manager&lt;/P&gt;&lt;P&gt;FROM [file](qvd);&lt;/P&gt;&lt;P&gt;FinalTABL:&lt;/P&gt;&lt;P&gt;NoConcatenate;&lt;/P&gt;&lt;P&gt;load all field names, if(isnull(Department),'NA',Department) as Department&lt;/P&gt;&lt;P&gt;Resident&amp;nbsp;&lt;SPAN&gt;joinedTbl&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;Drop table&amp;nbsp;&lt;SPAN&gt;joinedTbl&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you just want this to be done for a chart in frontend and not dataset, you can attempt using aggr( let me know I can share example)&lt;/P&gt;</description>
    <pubDate>Wed, 16 Oct 2019 11:30:04 GMT</pubDate>
    <dc:creator>asinha1991</dc:creator>
    <dc:date>2019-10-16T11:30:04Z</dc:date>
    <item>
      <title>Mapping/Handling Null or Empty Value</title>
      <link>https://community.qlik.com/t5/QlikView/Mapping-Handling-Null-or-Empty-Value/m-p/1635969#M446787</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I'm fairly new to Qlik and I've encountered a problem I am unable to resolve. I'm hoping someone can point me in the right direction! I feel like I might be approaching the issue from the wrong direction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Scenario&lt;/STRONG&gt;: I'm loading two QVD files which link by "Name". However, some names do not exist on one of the QVDs resulting in "-" value under one of the fields. I'll give a visual example below. To add a small twist, I'm already using an IF statement on the field in question which will be shown below too - this is to purge unwanted characters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example Code&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;Structure:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Name,&lt;/P&gt;&lt;P&gt;Location,&lt;/P&gt;&lt;P&gt;Supplier,&lt;/P&gt;&lt;P&gt;FROM [file](qvd);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Employees:&lt;/P&gt;&lt;P&gt;IF(LEN(TRIM(PurgeChar(Dept,'-0123456789')))&amp;gt;1,TRIM(PurgeChar(Dept,'-0123456789'))) AS Department,&lt;/P&gt;&lt;P&gt;Name,&lt;/P&gt;&lt;P&gt;Manager&lt;/P&gt;&lt;P&gt;FROM [file](qvd);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Results&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;'Supplier' lists the company but also any out-sourced companies. The 'Employees' QVD only lists staff employed directly whereas the 'Structure' QVD will list everyone. I've been attempting to map 'null' to provide a Department for any outsourced employees.&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Name&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Manager&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Location&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Department&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Supplier&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;[Employee Name 1]&lt;/TD&gt;&lt;TD&gt;[Manager Name 1]&lt;/TD&gt;&lt;TD&gt;England&lt;/TD&gt;&lt;TD&gt;Sales&lt;/TD&gt;&lt;TD&gt;Company1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;[Employee Name 2]&lt;/TD&gt;&lt;TD&gt;[Manager Name 2]&lt;/TD&gt;&lt;TD&gt;Scotland&lt;/TD&gt;&lt;TD&gt;Communications&lt;/TD&gt;&lt;TD&gt;Company1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;[Employee Name 3]&lt;/TD&gt;&lt;TD&gt;[Manager Name 3]&lt;/TD&gt;&lt;TD&gt;England&lt;/TD&gt;&lt;TD&gt;-&lt;/TD&gt;&lt;TD&gt;Company2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;[Employee Name 4]&lt;/TD&gt;&lt;TD&gt;[Manager Name 4]&lt;/TD&gt;&lt;TD&gt;Wales&lt;/TD&gt;&lt;TD&gt;Logistics&lt;/TD&gt;&lt;TD&gt;Company1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;[Employee Name 5]&lt;/TD&gt;&lt;TD&gt;[Manager Name 5]&lt;/TD&gt;&lt;TD&gt;Wales&lt;/TD&gt;&lt;TD&gt;-&lt;/TD&gt;&lt;TD&gt;Company2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;[Employee Name 6]&lt;/TD&gt;&lt;TD&gt;[Manager Name 6]&lt;/TD&gt;&lt;TD&gt;Scotland&lt;/TD&gt;&lt;TD&gt;-&lt;/TD&gt;&lt;TD&gt;Company2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Luckily, any of the outsourced employees from 'Company2' only need to be placed into the 'Sales' Department.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What I have tried:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have tried mapping over those 'Nulls' in various methods. On reflection I'm not entirely sure that is the way forward though - I'm wondering if the issue is because the data doesn't exist, or even a space for it, after loading everything.&lt;/P&gt;&lt;P&gt;I have also tried LEFT JOIN without any differing results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts/help/direction appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 11:02:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Mapping-Handling-Null-or-Empty-Value/m-p/1635969#M446787</guid>
      <dc:creator>Luigi_Qlik</dc:creator>
      <dc:date>2019-10-16T11:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping/Handling Null or Empty Value</title>
      <link>https://community.qlik.com/t5/QlikView/Mapping-Handling-Null-or-Empty-Value/m-p/1635975#M446789</link>
      <description>&lt;P&gt;Where is code where you have mapped Department?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 11:10:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Mapping-Handling-Null-or-Empty-Value/m-p/1635975#M446789</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-10-16T11:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping/Handling Null or Empty Value</title>
      <link>https://community.qlik.com/t5/QlikView/Mapping-Handling-Null-or-Empty-Value/m-p/1635987#M446791</link>
      <description>&lt;P&gt;Hi, sorry, didn't think to include it because they were failures. In retrospect I should have so you could see what hasn't worked thus far.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Attempt&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;#1:&lt;/STRONG&gt; I've tried a variation of checks for blanks, nulls, hyphens so I'll show these all below as one&lt;/P&gt;&lt;P&gt;DeptNull:&lt;BR /&gt;Mapping LOAD * Inline&lt;BR /&gt;[&lt;BR /&gt;Dept,RenameDept&lt;BR /&gt;'','blank'&lt;BR /&gt;' ','space'&lt;BR /&gt;' ','two spaces'&lt;BR /&gt;'-','hyphen'&lt;BR /&gt;Null(),'Null'&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Employees:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;ApplyMap('DeptNull',Dept),&lt;/P&gt;&lt;P&gt;IF(LEN(TRIM(PurgeChar(Dept,'-0123456789')))&amp;gt;1,TRIM(PurgeChar(Dept,'-0123456789'))) AS Department,&lt;/P&gt;&lt;P&gt;Name,&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Attempt #2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;DeptNull:&lt;/P&gt;&lt;P&gt;MAPPING LOAD&lt;BR /&gt;Null(),&lt;BR /&gt;'Sales'&lt;BR /&gt;AutoGenerate 1;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MAP Dept USING DeptNull;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 11:23:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Mapping-Handling-Null-or-Empty-Value/m-p/1635987#M446791</guid>
      <dc:creator>Luigi_Qlik</dc:creator>
      <dc:date>2019-10-16T11:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping/Handling Null or Empty Value</title>
      <link>https://community.qlik.com/t5/QlikView/Mapping-Handling-Null-or-Empty-Value/m-p/1635993#M446792</link>
      <description>&lt;P&gt;I think you are trying to add this to the Employee table where the rows don't even exists from what I understand... may be try this instead&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;tmpStructure:
LOAD Name,
     Location,
     Supplier,
FROM [file](qvd);

Left Join (tmpStructure)
LOAD Name,
     If(Len(Trim(PurgeChar(Dept, '-0123456789'))) &amp;gt; 1, Trim(PurgeChar(Dept, '-0123456789'))) as Department,
     Manager
FROM [file](qvd);

Structure:
NoConcatenate
LOAD Name,
     Location,
     Supplier,
     Manager,
     If(Len(Trim(Department)) &amp;gt; 0, Department, 'Sales') as Department
Resident tmpStructure;

DROP Table tmpStructure;&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 16 Oct 2019 11:29:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Mapping-Handling-Null-or-Empty-Value/m-p/1635993#M446792</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-10-16T11:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping/Handling Null or Empty Value</title>
      <link>https://community.qlik.com/t5/QlikView/Mapping-Handling-Null-or-Empty-Value/m-p/1635994#M446793</link>
      <description>&lt;P&gt;the scenario you have generates empty value and not null, if you want to handle it as null you need to join these tables&lt;/P&gt;&lt;P&gt;and apply transformation on top it for example&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;joinedTbl:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Name,&lt;/P&gt;&lt;P&gt;Location,&lt;/P&gt;&lt;P&gt;Supplier,&lt;/P&gt;&lt;P&gt;FROM [file](qvd);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;outer join&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;IF(LEN(TRIM(PurgeChar(Dept,'-0123456789')))&amp;gt;1,TRIM(PurgeChar(Dept,'-0123456789'))) AS Department,&lt;/P&gt;&lt;P&gt;Name,&lt;/P&gt;&lt;P&gt;Manager&lt;/P&gt;&lt;P&gt;FROM [file](qvd);&lt;/P&gt;&lt;P&gt;FinalTABL:&lt;/P&gt;&lt;P&gt;NoConcatenate;&lt;/P&gt;&lt;P&gt;load all field names, if(isnull(Department),'NA',Department) as Department&lt;/P&gt;&lt;P&gt;Resident&amp;nbsp;&lt;SPAN&gt;joinedTbl&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;Drop table&amp;nbsp;&lt;SPAN&gt;joinedTbl&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you just want this to be done for a chart in frontend and not dataset, you can attempt using aggr( let me know I can share example)&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 11:30:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Mapping-Handling-Null-or-Empty-Value/m-p/1635994#M446793</guid>
      <dc:creator>asinha1991</dc:creator>
      <dc:date>2019-10-16T11:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping/Handling Null or Empty Value</title>
      <link>https://community.qlik.com/t5/QlikView/Mapping-Handling-Null-or-Empty-Value/m-p/1636045#M446795</link>
      <description>&lt;P&gt;That works beautifully! Thank you very much!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 12:19:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Mapping-Handling-Null-or-Empty-Value/m-p/1636045#M446795</guid>
      <dc:creator>Luigi_Qlik</dc:creator>
      <dc:date>2019-10-16T12:19:40Z</dc:date>
    </item>
  </channel>
</rss>

