<?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: Imputation for missing strings in QlikView in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Imputation-for-missing-strings-in-QlikView/m-p/1660281#M730255</link>
    <description>&lt;P&gt;IF either of the posters solutions worked for you, be sure to return to the thread and use the Accept as Solution button on the post(s) that helped to give them credit for the assistance and let other Community Members know what worked for you.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only additional thing I have is base URL link to the Design Blog area where there are hundreds of how-to posts on a variety of topics that may give you some additional ideas:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
    <pubDate>Mon, 23 Dec 2019 18:47:50 GMT</pubDate>
    <dc:creator>Brett_Bleess</dc:creator>
    <dc:date>2019-12-23T18:47:50Z</dc:date>
    <item>
      <title>Imputation for missing strings in QlikView</title>
      <link>https://community.qlik.com/t5/QlikView/Imputation-for-missing-strings-in-QlikView/m-p/1658520#M730252</link>
      <description>&lt;P&gt;I have a big dataset with 20% of missing strings.&lt;/P&gt;&lt;PRE&gt;NAME      |  AREA
--------------------------
Andy      |  Sales
Andy      |  NA
Andy      |  Sales
Andy      |  Sales
Andy      |  NA
Andy      |  Sales
Sandy     |  Construction
Sandy     |  Construction
Sandy     |  NA
Sandy     |  Construction
Sandy     |  Construction
Wendy     |  Planting
Wendy     |  Driving
Wendy     |  NA
Wendy     |  NA
Wendy     |  NA&lt;/PRE&gt;&lt;P&gt;In most cases of my data it is almost obvious, that Andy does Sales and Sandy is in Construction. But we cannot make sure about Wendy.&lt;/P&gt;&lt;P&gt;My desirable result is:&lt;/P&gt;&lt;PRE&gt;NAME      |  AREA
--------------------------
Andy      |  Sales
Andy      |  Sales
Andy      |  Sales
Andy      |  Sales
Andy      |  Sales
Andy      |  Sales
Sandy     |  Construction
Sandy     |  Construction
Sandy     |  Construction
Sandy     |  Construction
Sandy     |  Construction
Wendy     |  Planting
Wendy     |  Driving
Wendy     |  NA
Wendy     |  NA
Wendy     |  NA&lt;/PRE&gt;&lt;P&gt;Which is the best way to handle it in QlikView?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Imputation-for-missing-strings-in-QlikView/m-p/1658520#M730252</guid>
      <dc:creator>Nihat</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Imputation for missing strings in QlikView</title>
      <link>https://community.qlik.com/t5/QlikView/Imputation-for-missing-strings-in-QlikView/m-p/1658539#M730253</link>
      <description>&lt;P&gt;Data:&lt;BR /&gt;load * Inline [&lt;BR /&gt;NAME | AREA&lt;BR /&gt;Andy | Sales&lt;BR /&gt;Andy | NA&lt;BR /&gt;Andy | Sales&lt;BR /&gt;Andy | Sales&lt;BR /&gt;Andy | NA&lt;BR /&gt;Andy | Sales&lt;BR /&gt;Sandy | Construction&lt;BR /&gt;Sandy | Construction&lt;BR /&gt;Sandy | NA&lt;BR /&gt;Sandy | Construction&lt;BR /&gt;Sandy | Construction&lt;BR /&gt;Wendy | Planting&lt;BR /&gt;Wendy | Driving&lt;BR /&gt;Wendy | NA&lt;BR /&gt;Wendy | NA&lt;BR /&gt;Wendy | NA ] (delimiter is '|');&lt;/P&gt;&lt;P&gt;Left Join&lt;BR /&gt;Load Distinct NAME,&lt;BR /&gt;count( DISTINCT AREA) as AREA_DISTINCT_COUNT&lt;BR /&gt;Resident Data&lt;BR /&gt;where trim(AREA)&amp;lt;&amp;gt;'NA'&lt;BR /&gt;Group by NAME;&lt;/P&gt;&lt;P&gt;Left Join&lt;BR /&gt;Load Distinct NAME,&lt;BR /&gt;AREA as NEW_AREA&lt;BR /&gt;Resident Data&lt;BR /&gt;where AREA_DISTINCT_COUNT=1 and trim(AREA)&amp;lt;&amp;gt;'NA';&lt;/P&gt;&lt;P&gt;Final:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;Load NAME,if(len(trim(NEW_AREA))=0,AREA,NEW_AREA) as AREA&lt;BR /&gt;Resident Data;&lt;/P&gt;&lt;P&gt;Drop Table Data;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 14:37:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Imputation-for-missing-strings-in-QlikView/m-p/1658539#M730253</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2019-12-17T14:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Imputation for missing strings in QlikView</title>
      <link>https://community.qlik.com/t5/QlikView/Imputation-for-missing-strings-in-QlikView/m-p/1658722#M730254</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My proposal :&lt;/P&gt;&lt;LI-CODE lang="python"&gt;TEMPS:
load Rowno() as ID,* inline [
NAME,AREA
Andy,Sales
Andy,NA
Andy,Sales
Andy,Sales
Andy,NA
Andy,Sales
Sandy,Construction
Sandy,Construction
Sandy,NA
Sandy,Construction
Sandy,Construction
Wendy,Planting
Wendy,Driving
Wendy,NA
Wendy,NA
Wendy,NA
];

map1:
mapping load
NAME as CNAME,
mode(if(AREA&amp;lt;&amp;gt;'NA',AREA)) as CAREA
resident TEMPS
GROUP BY NAME;


RESULT:
load
ID as New_ID,
NAME as New_NAME,
if(isnull(ApplyMap('map1', NAME)),AREA,ApplyMap('map1', NAME)) As New_AREA
resident TEMPS;

DROP TABLE TEMPS;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 358px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/25695iF1B04FE8DBEEB942/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 21:02:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Imputation-for-missing-strings-in-QlikView/m-p/1658722#M730254</guid>
      <dc:creator>Taoufiq_Zarra</dc:creator>
      <dc:date>2019-12-17T21:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: Imputation for missing strings in QlikView</title>
      <link>https://community.qlik.com/t5/QlikView/Imputation-for-missing-strings-in-QlikView/m-p/1660281#M730255</link>
      <description>&lt;P&gt;IF either of the posters solutions worked for you, be sure to return to the thread and use the Accept as Solution button on the post(s) that helped to give them credit for the assistance and let other Community Members know what worked for you.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only additional thing I have is base URL link to the Design Blog area where there are hundreds of how-to posts on a variety of topics that may give you some additional ideas:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2019 18:47:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Imputation-for-missing-strings-in-QlikView/m-p/1660281#M730255</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2019-12-23T18:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Imputation for missing strings in QlikView</title>
      <link>https://community.qlik.com/t5/QlikView/Imputation-for-missing-strings-in-QlikView/m-p/1662092#M730256</link>
      <description>&lt;P&gt;Thank you for the reply,&lt;/P&gt;&lt;P&gt;It seems working for me when I use one map, but I have some problems in case of multiple mappings:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;map1:&lt;BR /&gt;mapping load&lt;BR /&gt;Name as CName,&lt;BR /&gt;mode(if(Occupation1&amp;lt;&amp;gt;'NA',Occupation1)) as COccupation1&lt;BR /&gt;resident Temp_CAD_DATA;&lt;/P&gt;&lt;P&gt;map2:&lt;BR /&gt;mapping load&lt;BR /&gt;Name as CName,&lt;BR /&gt;mode(if(Occupation2&amp;lt;&amp;gt;'NA',Occupation2)) as COccupation2&lt;BR /&gt;resident Temp_CAD_DATA;&lt;/P&gt;&lt;P&gt;map3:&lt;BR /&gt;mapping load&lt;BR /&gt;Name as CName,&lt;BR /&gt;mode(if(Occupation3&amp;lt;&amp;gt;'NA',Occupation3)) as COccupation3&lt;BR /&gt;resident Temp_CAD_DATA;&lt;/P&gt;&lt;P&gt;GROUP BY Name;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;RESULT:&lt;BR /&gt;load&lt;BR /&gt;if(isnull(ApplyMap('map1', Name)),Occupation1,ApplyMap('map1', Name)) As Occupation1&lt;BR /&gt;resident Temp_CAD_DATA;&lt;/P&gt;&lt;P&gt;load&lt;BR /&gt;if(isnull(ApplyMap('map2', Name)),Occupation2,ApplyMap('map2', Name)) As Occupation2&lt;BR /&gt;resident Temp_CAD_DATA;&lt;/P&gt;&lt;P&gt;load&lt;BR /&gt;if(isnull(ApplyMap('map3', Name)),Occupation3,ApplyMap('map3', Name)) As Occupation3&lt;BR /&gt;resident Temp_CAD_DATA;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;DROP TABLE Temp_CAD_DATA;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 13:12:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Imputation-for-missing-strings-in-QlikView/m-p/1662092#M730256</guid>
      <dc:creator>Nihat</dc:creator>
      <dc:date>2020-01-02T13:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: Imputation for missing strings in QlikView</title>
      <link>https://community.qlik.com/t5/QlikView/Imputation-for-missing-strings-in-QlikView/m-p/1662100#M730257</link>
      <description>&lt;LI-CODE lang="markup"&gt;You need to apply Group by in individual mapping table. Also, combine if ..else in single load instead of doing it in separate load

map1:
mapping load
Name as CName,
mode(if(Occupation1&amp;lt;&amp;gt;'NA',Occupation1)) as COccupation1
resident Temp_CAD_DATA
GROUP BY Name;

map2:
mapping load
Name as CName,
mode(if(Occupation2&amp;lt;&amp;gt;'NA',Occupation2)) as COccupation2
resident Temp_CAD_DATA
GROUP BY Name;

map3:
mapping load
Name as CName,
mode(if(Occupation3&amp;lt;&amp;gt;'NA',Occupation3)) as COccupation3
resident Temp_CAD_DATA;
GROUP BY Name;


RESULT:
load
if(isnull(ApplyMap('map1', Name)),Occupation1,ApplyMap('map1', Name)) As Occupation1,
if(isnull(ApplyMap('map2', Name)),Occupation2,ApplyMap('map2', Name)) As Occupation2,
if(isnull(ApplyMap('map3', Name)),Occupation3,ApplyMap('map3', Name)) As Occupation3
resident Temp_CAD_DATA;


DROP TABLE Temp_CAD_DATA;&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 02 Jan 2020 13:42:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Imputation-for-missing-strings-in-QlikView/m-p/1662100#M730257</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-01-02T13:42:51Z</dc:date>
    </item>
  </channel>
</rss>

