<?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: IF statement not working as expected in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/IF-statement-not-working-as-expected/m-p/2138489#M92526</link>
    <description>&lt;P&gt;If it's working with this new field you may add:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;NoConcatenate&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LT:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Load&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field1,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field2,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field3,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field4,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field5,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field6,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(field6='A', 'AB', field6) as field6_new,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field7&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Resident LT_temp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Drop Table LT_temp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;drop fields field6 from LT; rename field6_new to field6;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;If it failed because field6 exists within any other table you may change the adjustment-query to:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;if(keepchar(field6, 'AB') ='A', 'AB', field6) as field6&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Beside this it not necessary to apply such change within a resident-load on a temp-table else it could be already applied within the origin-load.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Nov 2023 16:10:25 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2023-11-16T16:10:25Z</dc:date>
    <item>
      <title>IF statement not working as expected</title>
      <link>https://community.qlik.com/t5/App-Development/IF-statement-not-working-as-expected/m-p/2138445#M92522</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I have an issue trying to change the value of a field in a table using an if statement that is not working.&lt;/P&gt;
&lt;P&gt;I made a Link Table with different field and for a new project I need to change the value of a field of this link table.&lt;BR /&gt;Let's say my link table is called LT_temp and has 7 fields. I need to change the value of a single field that can be 'A' or 'B'&amp;nbsp;as follows:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if field value equals 'A' then field value must become 'AB', else it must remain 'B'.&lt;/P&gt;
&lt;P&gt;I tryed something like this:&lt;BR /&gt;LT:&lt;BR /&gt;Load&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field1,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field2,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field3,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field4,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field5,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(field6='A', 'AB', field6) as field6,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field7&lt;BR /&gt;Resident LT_temp;&lt;BR /&gt;Drop Table LT_temp;&lt;/P&gt;
&lt;P&gt;But as soon as i run the code, as a result I only have 'B' as value for field6.&lt;/P&gt;
&lt;P&gt;I can't figure out how to solve it...help is very much appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 14:54:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/IF-statement-not-working-as-expected/m-p/2138445#M92522</guid>
      <dc:creator>RickF</dc:creator>
      <dc:date>2023-11-16T14:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement not working as expected</title>
      <link>https://community.qlik.com/t5/App-Development/IF-statement-not-working-as-expected/m-p/2138448#M92523</link>
      <description>&lt;P&gt;I'd suggest confirming the value is actually 'A'. There may be hidden spaces (in which case you'd want to trim() the value) or other non-visible characters.&lt;/P&gt;
&lt;P&gt;You'll also want to use Noconcatenate Load here, since you're using the exact same field names as the original table. Your issue might be that you are unintentionally dropping both iterations.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 14:58:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/IF-statement-not-working-as-expected/m-p/2138448#M92523</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2023-11-16T14:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement not working as expected</title>
      <link>https://community.qlik.com/t5/App-Development/IF-statement-not-working-as-expected/m-p/2138455#M92524</link>
      <description>&lt;P&gt;You're right, i need to use NoConcatenate load as I did but forgot to write in the example...&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;As suggested I tried to use trim(field6) but it results in the same behavior as without trim.&lt;/P&gt;
&lt;P&gt;I think that there should not be any non-visible character because creating&amp;nbsp;a completely new field based on the same if statement works as expected.&lt;/P&gt;
&lt;P&gt;NoConcatenate&lt;BR /&gt;&lt;SPAN&gt;LT:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Load&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field1,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field2,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field3,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field4,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field5,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field6,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(field6='A', 'AB', field6) as field6_new,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field7&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Resident LT_temp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Drop Table LT_temp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Problem is I can't use a new field, I must use the old one with the new code AB instead of A&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 15:09:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/IF-statement-not-working-as-expected/m-p/2138455#M92524</guid>
      <dc:creator>RickF</dc:creator>
      <dc:date>2023-11-16T15:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement not working as expected</title>
      <link>https://community.qlik.com/t5/App-Development/IF-statement-not-working-as-expected/m-p/2138489#M92526</link>
      <description>&lt;P&gt;If it's working with this new field you may add:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;NoConcatenate&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LT:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Load&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field1,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field2,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field3,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field4,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field5,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field6,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(field6='A', 'AB', field6) as field6_new,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field7&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Resident LT_temp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Drop Table LT_temp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;drop fields field6 from LT; rename field6_new to field6;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;If it failed because field6 exists within any other table you may change the adjustment-query to:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;if(keepchar(field6, 'AB') ='A', 'AB', field6) as field6&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Beside this it not necessary to apply such change within a resident-load on a temp-table else it could be already applied within the origin-load.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 16:10:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/IF-statement-not-working-as-expected/m-p/2138489#M92526</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-11-16T16:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement not working as expected</title>
      <link>https://community.qlik.com/t5/App-Development/IF-statement-not-working-as-expected/m-p/2138492#M92527</link>
      <description>&lt;P&gt;Try this&lt;BR /&gt;if(Upper(Trim(field6)) = 'A', 'AB', field6) as field6,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 16:17:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/IF-statement-not-working-as-expected/m-p/2138492#M92527</guid>
      <dc:creator>Aasir</dc:creator>
      <dc:date>2023-11-16T16:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement not working as expected</title>
      <link>https://community.qlik.com/t5/App-Development/IF-statement-not-working-as-expected/m-p/2138498#M92529</link>
      <description>&lt;P&gt;With saying "&lt;SPAN&gt;field6 exists within any other table" you helped me discovering that field6 is a field in another table used for section access.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;In the end the problem wasn't actually related to the if statement, it was related to the section access.&lt;BR /&gt;The new value 'AB' was not a possible value for the section access file used and because of this I wasn't able anymore to see data with field6='AB'.&lt;/P&gt;
&lt;P&gt;Adding 'AB' as a possible value for field6 in the file used for section access It turned out that all is now working as expected.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 16:36:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/IF-statement-not-working-as-expected/m-p/2138498#M92529</guid>
      <dc:creator>RickF</dc:creator>
      <dc:date>2023-11-16T16:36:49Z</dc:date>
    </item>
  </channel>
</rss>

