<?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: GetFieldSelections with IF and Replace in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/GetFieldSelections-with-IF-and-Replace/m-p/2033893#M85191</link>
    <description>&lt;P&gt;if what you want to do is replace the shift code with some description and you only have 2 values you can use it in cascade:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Replace(
   Replace(
      GetFieldSelections(WORKSHIFT),
      'Morning', 
      'This is Work shift 2'
   ),
   'Night 1', 
   'This is Work shift 1'
)&lt;/LI-CODE&gt;
&lt;P&gt;the result of the inner replace becomes the input to the outer one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;however, i would suggest a different way.&amp;nbsp; i would create an association between WORKSHIFT and a WORKSHIFT_DESC field.&amp;nbsp; where&amp;nbsp;WORKSHIFT_DESC is obviously the description.&amp;nbsp; when workshift is selected, the descriptions are&lt;BR /&gt;=concat(distinct&amp;nbsp;WORKSHIFT_DESC,',')&amp;nbsp; which will be the same result.&amp;nbsp; however, the advantage of this is you can have as many values for&amp;nbsp;WORKSHIFT and you dont need to change your code.&amp;nbsp; that is, if tomorrow, a new value is added you will need 3 levels of replace.&lt;BR /&gt;&lt;BR /&gt;this may not apply to you but at least you know there is an alternative for the future.&lt;/P&gt;</description>
    <pubDate>Fri, 03 Feb 2023 13:15:38 GMT</pubDate>
    <dc:creator>edwin</dc:creator>
    <dc:date>2023-02-03T13:15:38Z</dc:date>
    <item>
      <title>GetFieldSelections with IF and Replace</title>
      <link>https://community.qlik.com/t5/App-Development/GetFieldSelections-with-IF-and-Replace/m-p/2033867#M85188</link>
      <description>&lt;P&gt;Hi, guys!&lt;/P&gt;
&lt;P&gt;Hello everyone, I can't use GetFieldSelections in an IF in script? I did this in the code however, it is not working.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;=IF(Replace(GetFieldSelections(WORKSHIFT),'Night 1', 'This is Work shift 1',
IF(Replace(GetFieldSelections(WORKSHIFT),'Morning', 'This is Work shift 2'))))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 12:43:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/GetFieldSelections-with-IF-and-Replace/m-p/2033867#M85188</guid>
      <dc:creator>lucasx15</dc:creator>
      <dc:date>2023-02-03T12:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: GetFieldSelections with IF and Replace</title>
      <link>https://community.qlik.com/t5/App-Development/GetFieldSelections-with-IF-and-Replace/m-p/2033893#M85191</link>
      <description>&lt;P&gt;if what you want to do is replace the shift code with some description and you only have 2 values you can use it in cascade:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Replace(
   Replace(
      GetFieldSelections(WORKSHIFT),
      'Morning', 
      'This is Work shift 2'
   ),
   'Night 1', 
   'This is Work shift 1'
)&lt;/LI-CODE&gt;
&lt;P&gt;the result of the inner replace becomes the input to the outer one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;however, i would suggest a different way.&amp;nbsp; i would create an association between WORKSHIFT and a WORKSHIFT_DESC field.&amp;nbsp; where&amp;nbsp;WORKSHIFT_DESC is obviously the description.&amp;nbsp; when workshift is selected, the descriptions are&lt;BR /&gt;=concat(distinct&amp;nbsp;WORKSHIFT_DESC,',')&amp;nbsp; which will be the same result.&amp;nbsp; however, the advantage of this is you can have as many values for&amp;nbsp;WORKSHIFT and you dont need to change your code.&amp;nbsp; that is, if tomorrow, a new value is added you will need 3 levels of replace.&lt;BR /&gt;&lt;BR /&gt;this may not apply to you but at least you know there is an alternative for the future.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 13:15:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/GetFieldSelections-with-IF-and-Replace/m-p/2033893#M85191</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2023-02-03T13:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: GetFieldSelections with IF and Replace</title>
      <link>https://community.qlik.com/t5/App-Development/GetFieldSelections-with-IF-and-Replace/m-p/2033902#M85193</link>
      <description>&lt;P&gt;Thank you, Edwin!!!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 13:30:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/GetFieldSelections-with-IF-and-Replace/m-p/2033902#M85193</guid>
      <dc:creator>lucasx15</dc:creator>
      <dc:date>2023-02-03T13:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: GetFieldSelections with IF and Replace</title>
      <link>https://community.qlik.com/t5/App-Development/GetFieldSelections-with-IF-and-Replace/m-p/2033905#M85195</link>
      <description>&lt;P&gt;yw&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 13:33:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/GetFieldSelections-with-IF-and-Replace/m-p/2033905#M85195</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2023-02-03T13:33:45Z</dc:date>
    </item>
  </channel>
</rss>

