<?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: CASE Statement Question in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/CASE-Statement-Question/m-p/1994359#M82309</link>
    <description>&lt;P&gt;Thank you Or for your suggestion which worked absolutely fine!&lt;/P&gt;
&lt;P&gt;If, instead of hard-coding all the codes that we are testing against (A1, A2 etc in the example), do you have any suggestions on how this can be modified to read the list from a table (say an Excel spreadsheet or a Mapping LOAD table for example) as the list of codes is likely to change from time to time?&lt;/P&gt;
&lt;P&gt;Thanks again&lt;/P&gt;
&lt;P&gt;Alexis&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Oct 2022 09:16:32 GMT</pubDate>
    <dc:creator>alexis</dc:creator>
    <dc:date>2022-10-19T09:16:32Z</dc:date>
    <item>
      <title>CASE Statement Question</title>
      <link>https://community.qlik.com/t5/App-Development/CASE-Statement-Question/m-p/1986555#M81512</link>
      <description>&lt;P&gt;I am reading a field (Let's call it "&lt;EM&gt;ReasonCode&lt;/EM&gt;") from a table that contains a range of values like "A1", "A2","A3", "A4", "A5", "B1", "B2", "B3", "B4", "B5", "C1", "C2", "C3", "C4", "C5", "D1" as well as blank or&amp;nbsp;&lt;EM&gt;Null().&lt;/EM&gt;,&lt;/P&gt;
&lt;P&gt;The brief is to create a new field (or just replace ReasonCode) that contains values that meet the following rules:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;If&amp;nbsp; "A1", "A2", "A3", "B1", "B2" or "B3" then carry these values to the new field&lt;/LI&gt;
&lt;LI&gt;If Null() or blank then the new field contains blank or Null()&lt;/LI&gt;
&lt;LI&gt;If any of the other values (but not blank or null) then the new field to contain "OTHER"&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Any idea what the most efficient way is to do this in Qlik?&lt;/P&gt;
&lt;P&gt;Regards and thanks in advance&lt;/P&gt;
&lt;P&gt;Alexis&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 13:22:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/CASE-Statement-Question/m-p/1986555#M81512</guid>
      <dc:creator>alexis</dc:creator>
      <dc:date>2022-09-28T13:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: CASE Statement Question</title>
      <link>https://community.qlik.com/t5/App-Development/CASE-Statement-Question/m-p/1986574#M81516</link>
      <description>&lt;P&gt;If(Len(Field)=0 OR Match(Field,'A1','A2', 'A3','B1','B2','B3'),Field,'OTHER') should work here.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 13:53:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/CASE-Statement-Question/m-p/1986574#M81516</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2022-09-28T13:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: CASE Statement Question</title>
      <link>https://community.qlik.com/t5/App-Development/CASE-Statement-Question/m-p/1994359#M82309</link>
      <description>&lt;P&gt;Thank you Or for your suggestion which worked absolutely fine!&lt;/P&gt;
&lt;P&gt;If, instead of hard-coding all the codes that we are testing against (A1, A2 etc in the example), do you have any suggestions on how this can be modified to read the list from a table (say an Excel spreadsheet or a Mapping LOAD table for example) as the list of codes is likely to change from time to time?&lt;/P&gt;
&lt;P&gt;Thanks again&lt;/P&gt;
&lt;P&gt;Alexis&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 09:16:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/CASE-Statement-Question/m-p/1994359#M82309</guid>
      <dc:creator>alexis</dc:creator>
      <dc:date>2022-10-19T09:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: CASE Statement Question</title>
      <link>https://community.qlik.com/t5/App-Development/CASE-Statement-Question/m-p/1994389#M82312</link>
      <description>&lt;P&gt;Sounds like mapping load would be an option, something along the lines of:&lt;/P&gt;
&lt;P&gt;If(Len(Field)=0 OR NOT ISNULL( ApplyMap('MappingLoadTable',Field,null())),Field,'Other')&lt;/P&gt;
&lt;P&gt;Though I imagine there's any number of other ways to achieve this (such as two separate loads with Exists/Not Exists, or a second pass load after the values have been joined/mapped in, and probably other ways as well).&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 10:19:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/CASE-Statement-Question/m-p/1994389#M82312</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2022-10-19T10:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: CASE Statement Question</title>
      <link>https://community.qlik.com/t5/App-Development/CASE-Statement-Question/m-p/1996685#M82546</link>
      <description>&lt;P&gt;Thanks for the suggestion - although it didn't quite work, it gave me the idea to construct my own version which is a simplified version of yours (I removed some application-specific variations for inclusion here):&lt;/P&gt;
&lt;P&gt;if (Len(Field)&amp;gt;0,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; /// Some if conditions here that are special cases of 'Field'&lt;BR /&gt;&amp;nbsp; &amp;nbsp; I&lt;SPAN&gt;f(Field = 'Some Special Value, 'Special',&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&lt;/SPAN&gt;&lt;SPAN&gt;pplyMap('MappingLoadTable', Field, 'Unknown'))) As Field_Text&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks again&lt;BR /&gt;Alexis&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 15:00:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/CASE-Statement-Question/m-p/1996685#M82546</guid>
      <dc:creator>alexis</dc:creator>
      <dc:date>2022-10-25T15:00:46Z</dc:date>
    </item>
  </channel>
</rss>

