<?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 value using Calculation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Replacing-value-using-Calculation/m-p/527647#M197185</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;1) In your table 2, C Values 00001, 00002 are not numeric value, these are text values,&lt;/P&gt;&lt;P&gt;numeric or integer value can not have 0 before any digit, like 002 will be equal to 2, and when you will check&lt;/P&gt;&lt;P&gt;if(c=2), i will return false... if c contain 002.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) If you are reading data from sql server, and when you will check if(c= -1), and if c contain NULL,&lt;/P&gt;&lt;P&gt;it will not return you true, or false , it will return you Unknown. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so isnum() will not work in this case...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Oct 2013 10:52:45 GMT</pubDate>
    <dc:creator>israrkhan</dc:creator>
    <dc:date>2013-10-25T10:52:45Z</dc:date>
    <item>
      <title>Replacing value using Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Replacing-value-using-Calculation/m-p/527643#M197181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am scanning a filed in a table for numeric value using IsNum function. The condition is if the value is not a number then the value should be changed with a value from different table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="136"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" colspan="2" height="20" width="136"&gt;Table 1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;A&lt;/TD&gt;&lt;TD class="xl63"&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;1&lt;/TD&gt;&lt;TD class="xl63"&gt;aaa&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;2&lt;/TD&gt;&lt;TD class="xl63"&gt;bbb&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;3&lt;/TD&gt;&lt;TD class="xl63"&gt;ccc&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="136"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" colspan="2" height="20" width="136"&gt;Table 2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;A&lt;/TD&gt;&lt;TD class="xl65"&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;1&lt;/TD&gt;&lt;TD class="xl66"&gt;00001&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;2&lt;/TD&gt;&lt;TD class="xl66"&gt;00002&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;3&lt;/TD&gt;&lt;TD class="xl66"&gt;Null&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Table 2, row number 3 has a NULL value and hence it should be replaced with ccc from Table 3.&lt;/P&gt;&lt;P&gt;The query I am using in Table 2 is:&lt;/P&gt;&lt;P&gt;if(isnum(C)=-1,C,B) as New_Filed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Oct 2013 10:33:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replacing-value-using-Calculation/m-p/527643#M197181</guid>
      <dc:creator />
      <dc:date>2013-10-25T10:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing value using Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Replacing-value-using-Calculation/m-p/527644#M197182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Make Table 1 into a mapping table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then replace your expression in Table 2 with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;if (IsNum(C), C, applymap('Table1',A)) as New_Field&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However the IsNum() function may have trouble detecting numerical values in a mixed-type column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Oct 2013 10:38:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replacing-value-using-Calculation/m-p/527644#M197182</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2013-10-25T10:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing value using Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Replacing-value-using-Calculation/m-p/527645#M197183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;Mapping&lt;/P&gt;&lt;P&gt;Load * Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;A,B&lt;/P&gt;&lt;P&gt;1,aaa&lt;/P&gt;&lt;P&gt;2,bbb&lt;/P&gt;&lt;P&gt;3,ccc&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table2:&lt;/P&gt;&lt;P&gt;LOAD *, if(IsNum(C), C, ApplyMap('Table1',A, 0)) As B;&lt;/P&gt;&lt;P&gt;LOAD * Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;A,C&lt;/P&gt;&lt;P&gt;1,00001&lt;/P&gt;&lt;P&gt;2,00002&lt;/P&gt;&lt;P&gt;3,Null&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Oct 2013 10:45:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replacing-value-using-Calculation/m-p/527645#M197183</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2013-10-25T10:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing value using Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Replacing-value-using-Calculation/m-p/527646#M197184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following is our query for Map Load:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A1:&lt;/P&gt;&lt;P&gt;Mapping Load&lt;/P&gt;&lt;P&gt;A,B&lt;/P&gt;&lt;P&gt;Resident Table1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And we used your query to replace the value/ Now we are getting an error which state "File B not found"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Oct 2013 10:50:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replacing-value-using-Calculation/m-p/527646#M197184</guid>
      <dc:creator />
      <dc:date>2013-10-25T10:50:44Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing value using Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Replacing-value-using-Calculation/m-p/527647#M197185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;1) In your table 2, C Values 00001, 00002 are not numeric value, these are text values,&lt;/P&gt;&lt;P&gt;numeric or integer value can not have 0 before any digit, like 002 will be equal to 2, and when you will check&lt;/P&gt;&lt;P&gt;if(c=2), i will return false... if c contain 002.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) If you are reading data from sql server, and when you will check if(c= -1), and if c contain NULL,&lt;/P&gt;&lt;P&gt;it will not return you true, or false , it will return you Unknown. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so isnum() will not work in this case...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Oct 2013 10:52:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replacing-value-using-Calculation/m-p/527647#M197185</guid>
      <dc:creator>israrkhan</dc:creator>
      <dc:date>2013-10-25T10:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing value using Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Replacing-value-using-Calculation/m-p/527648#M197186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based upon the reply given by Israr, I have to change my Table 2 as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="136"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" colspan="2" height="20" width="136"&gt;Table 2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;A&lt;/TD&gt;&lt;TD class="xl65"&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;1&lt;/TD&gt;&lt;TD class="xl66"&gt;762&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;2&lt;/TD&gt;&lt;TD class="xl66"&gt;145&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Oct 2013 11:05:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replacing-value-using-Calculation/m-p/527648#M197186</guid>
      <dc:creator />
      <dc:date>2013-10-25T11:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing value using Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Replacing-value-using-Calculation/m-p/527649#M197187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;add another condition to check null in your existing condition as below&lt;/P&gt;&lt;P&gt;if (isnum(c )) OR IF(ISNULL(C)).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Oct 2013 11:26:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replacing-value-using-Calculation/m-p/527649#M197187</guid>
      <dc:creator>israrkhan</dc:creator>
      <dc:date>2013-10-25T11:26:20Z</dc:date>
    </item>
  </channel>
</rss>

