<?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 Set expression that matches multiple strings values with separate list of strings in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-expression-that-matches-multiple-strings-values-with/m-p/2478035#M100439</link>
    <description>&lt;P&gt;I have a set expression that searches for a single product name in a list of product names:&lt;BR /&gt;&lt;BR /&gt;=if(match(product_number, {&amp;lt;isEUCountry={1}&amp;gt;}product_number)=1, 'Export possible', 'Export not possible')&lt;BR /&gt;&lt;BR /&gt;However, one product can have multiple ingredients and match only takes one string in its first parameter:&lt;/P&gt;
&lt;P class="syntax_heading" data-mc-autonum="Syntax: "&gt;&lt;SPAN class="autonumber"&gt;&lt;SPAN&gt;Syntax: &lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class="script_token"&gt;match(&lt;/SPAN&gt;&lt;SPAN class="bnf_token"&gt; str, expr1 [ , expr2,...exprN ]&lt;/SPAN&gt;&lt;SPAN class="script_token"&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="syntax_heading" data-mc-autonum="Syntax: "&gt;I want to do a similar search for ingredients in a list of ingredients, but I haven't found a function in Qlik that will take multiple strings in the first parameter:&lt;BR /&gt;&lt;BR /&gt;=if([function_name](list_of_ingredients, {&amp;lt;isEUCountry={1}&amp;gt;}list_of_ingredients)=1, 'Export possible', 'Export not possible')&lt;BR /&gt;&lt;BR /&gt;One alternative solution could be to loop the match function for each string in my list of ingredients, but not sure if that is possible.&lt;/P&gt;</description>
    <pubDate>Mon, 26 Aug 2024 14:12:29 GMT</pubDate>
    <dc:creator>prayner</dc:creator>
    <dc:date>2024-08-26T14:12:29Z</dc:date>
    <item>
      <title>Set expression that matches multiple strings values with separate list of strings</title>
      <link>https://community.qlik.com/t5/App-Development/Set-expression-that-matches-multiple-strings-values-with/m-p/2478035#M100439</link>
      <description>&lt;P&gt;I have a set expression that searches for a single product name in a list of product names:&lt;BR /&gt;&lt;BR /&gt;=if(match(product_number, {&amp;lt;isEUCountry={1}&amp;gt;}product_number)=1, 'Export possible', 'Export not possible')&lt;BR /&gt;&lt;BR /&gt;However, one product can have multiple ingredients and match only takes one string in its first parameter:&lt;/P&gt;
&lt;P class="syntax_heading" data-mc-autonum="Syntax: "&gt;&lt;SPAN class="autonumber"&gt;&lt;SPAN&gt;Syntax: &lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class="script_token"&gt;match(&lt;/SPAN&gt;&lt;SPAN class="bnf_token"&gt; str, expr1 [ , expr2,...exprN ]&lt;/SPAN&gt;&lt;SPAN class="script_token"&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="syntax_heading" data-mc-autonum="Syntax: "&gt;I want to do a similar search for ingredients in a list of ingredients, but I haven't found a function in Qlik that will take multiple strings in the first parameter:&lt;BR /&gt;&lt;BR /&gt;=if([function_name](list_of_ingredients, {&amp;lt;isEUCountry={1}&amp;gt;}list_of_ingredients)=1, 'Export possible', 'Export not possible')&lt;BR /&gt;&lt;BR /&gt;One alternative solution could be to loop the match function for each string in my list of ingredients, but not sure if that is possible.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2024 14:12:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-expression-that-matches-multiple-strings-values-with/m-p/2478035#M100439</guid>
      <dc:creator>prayner</dc:creator>
      <dc:date>2024-08-26T14:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Set expression that matches multiple strings values with separate list of strings</title>
      <link>https://community.qlik.com/t5/App-Development/Set-expression-that-matches-multiple-strings-values-with/m-p/2479080#M100554</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/220099"&gt;@prayner&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a set expression that searches for a single product name in a list of product names:&lt;BR /&gt;&lt;BR /&gt;=if(match(product_number, {&amp;lt;isEUCountry={1}&amp;gt;}product_number)=1, 'Export possible', 'Export not possible')&lt;BR /&gt;&lt;BR /&gt;However, one product can have multiple ingredients and match only takes one string in its first parameter:&amp;nbsp;&lt;A href="https://www.spotify-pie.com" target="_blank" rel="noopener"&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#FFFFFF"&gt;my spotify pie&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P class="syntax_heading" data-mc-autonum="Syntax: "&gt;&lt;SPAN class="autonumber"&gt;&lt;SPAN&gt;Syntax: &lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class="script_token"&gt;match(&lt;/SPAN&gt;&lt;SPAN class="bnf_token"&gt; str, expr1 [ , expr2,...exprN ]&lt;/SPAN&gt;&lt;SPAN class="script_token"&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="syntax_heading" data-mc-autonum="Syntax: "&gt;I want to do a similar search for ingredients in a list of ingredients, but I haven't found a function in Qlik that will take multiple strings in the first parameter:&lt;BR /&gt;&lt;BR /&gt;=if([function_name](list_of_ingredients, {&amp;lt;isEUCountry={1}&amp;gt;}list_of_ingredients)=1, 'Export possible', 'Export not possible')&lt;BR /&gt;&lt;BR /&gt;One alternative solution could be to loop the match function for each string in my list of ingredients, but not sure if that is possible.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;To achieve this in Qlik, you can use a combination of SubField and Match functions to handle multiple strings in your list of ingredients. Here’s a step-by-step approach:&lt;/P&gt;
&lt;P&gt;Split the Ingredients: Use the SubField function to split the list of ingredients into individual ingredients.&lt;BR /&gt;Match Each Ingredient: Use the Match function to check if each ingredient is in the list of ingredients for EU countries.&lt;BR /&gt;Aggregate the Results: Use an aggregation function like Max or Sum to determine if any of the ingredients match.&lt;BR /&gt;Here’s an example of how you can implement this:&lt;/P&gt;
&lt;P&gt;// Load your data&lt;BR /&gt;LOAD&lt;BR /&gt;product_number,&lt;BR /&gt;list_of_ingredients,&lt;BR /&gt;isEUCountry&lt;BR /&gt;FROM your_data_source;&lt;/P&gt;
&lt;P&gt;// Create a flag for export possibility&lt;BR /&gt;LOAD&lt;BR /&gt;product_number,&lt;BR /&gt;list_of_ingredients,&lt;BR /&gt;isEUCountry,&lt;BR /&gt;If(Max(Match(SubField(list_of_ingredients, ',', IterNo()), {&amp;lt;isEUCountry={1}&amp;gt;}list_of_ingredients)) &amp;gt; 0, 'Export possible', 'Export not possible') as ExportFlag&lt;BR /&gt;Resident your_data_source&lt;BR /&gt;While IterNo() &amp;lt;= SubStringCount(list_of_ingredients, ',') + 1;&lt;/P&gt;
&lt;P&gt;Explanation:&lt;BR /&gt;SubField: This function splits list_of_ingredients into individual ingredients based on the comma delimiter.&lt;BR /&gt;Match: This function checks if each ingredient is in the list of ingredients for EU countries.&lt;BR /&gt;Max: This function aggregates the results to determine if any of the ingredients match.&lt;BR /&gt;This approach ensures that you can handle multiple ingredients and check if any of them are in the list of ingredients for EU countries.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this will help you.&lt;BR /&gt;Best regards,&lt;BR /&gt;samuel898&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2024 03:58:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-expression-that-matches-multiple-strings-values-with/m-p/2479080#M100554</guid>
      <dc:creator>samuel898</dc:creator>
      <dc:date>2024-09-03T03:58:31Z</dc:date>
    </item>
  </channel>
</rss>

