<?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 Match And function for multiple values in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/If-Match-And-function-for-multiple-values/m-p/1719851#M54723</link>
    <description>&lt;P&gt;My model looks similar to what you showed. I have an Opportunity table. Then Products (salesforce oppty line item) table where the SKUs are. I create the product flags here then join it to the opportunity table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My expected output looks like what you showed. For context i have 3 product flags total. One opportunity record would have 3 columns: "CLM Flag", "Negotiate Flag", and "Gen Flag", and it would be 1 or 0 based on the SKU combination.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jun 2020 00:13:46 GMT</pubDate>
    <dc:creator>sungyunley</dc:creator>
    <dc:date>2020-06-18T00:13:46Z</dc:date>
    <item>
      <title>If Match And function for multiple values</title>
      <link>https://community.qlik.com/t5/App-Development/If-Match-And-function-for-multiple-values/m-p/1719836#M54715</link>
      <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to build a formula that looks at a combination of Product SKUs, but im hitting a road block. My goal is to say, if the opportunity has Product Code = 'APT-0577' then flag it as '1'. If it has any one of these codes:&amp;nbsp;'APT-0528', 'APT-0543', 'SCM1' &lt;STRONG&gt;AND&lt;/STRONG&gt; 'APT-0577' on the same oppty then flag it as '1'. If it only has&amp;nbsp;'APT-0528', 'APT-0543', 'SCM1'&amp;nbsp; then flag as '0'. Its mostly the AND piece that is stumping me. Im wondering if i have to create one giant IF statement to accommodate this, or if there's an easier way.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the code i currently have.&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Negotiate Flag. Negotiate flag is for Neg SKUs or when Neg and Gen are sold on same oppty&lt;BR /&gt;If(&lt;BR /&gt;Count(&lt;BR /&gt;If(&lt;BR /&gt;(Match([Product Code],'APT-0577')&amp;gt;=1 or Match([Product Code], 'APT-0528', 'APT-0543', 'SCM1')&amp;gt;=1)&lt;BR /&gt;and NAME &amp;lt;&amp;gt; Null()&lt;BR /&gt;and ISDELETED =0,&lt;BR /&gt;[Opportunity_ID]))&amp;gt;0, 1,0) as [Negotiate Flag],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 22:56:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-Match-And-function-for-multiple-values/m-p/1719836#M54715</guid>
      <dc:creator>sungyunley</dc:creator>
      <dc:date>2020-06-17T22:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: If Match And function for multiple values</title>
      <link>https://community.qlik.com/t5/App-Development/If-Match-And-function-for-multiple-values/m-p/1719847#M54720</link>
      <description>&lt;P&gt;Can you show the sample data and expected output? With my understanding I have prepared the below.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;tab1:
LOAD * INLINE [
    Opportunity_ID, Product Code
    1, APT-0577
    1, Test1
    2, APT-0528
    2, APT-0543
    3, Test2
    3, SCM1
    3, APT-0577
    4, APT-0529
    4, APT-0544
    4, SCM2
    4, Test3
];

Left Join(tab1)
LOAD Opportunity_ID, If(WildMatch(Concat(DISTINCT [Product Code]),'*APT-0528*', '*APT-0543*', '*APT-0577*', '*SCM1*'),1,
						If(WildMatch(Concat(DISTINCT [Product Code]),'*APT-0529*', '*APT-0544*', '*SCM2*'),0)) As Flag
Resident tab1
Group By Opportunity_ID
;&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="commQV41.PNG" style="width: 203px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/35755i3A85C711D486A312/image-size/large?v=v2&amp;amp;px=999" role="button" title="commQV41.PNG" alt="commQV41.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 23:46:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-Match-And-function-for-multiple-values/m-p/1719847#M54720</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2020-06-17T23:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: If Match And function for multiple values</title>
      <link>https://community.qlik.com/t5/App-Development/If-Match-And-function-for-multiple-values/m-p/1719851#M54723</link>
      <description>&lt;P&gt;My model looks similar to what you showed. I have an Opportunity table. Then Products (salesforce oppty line item) table where the SKUs are. I create the product flags here then join it to the opportunity table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My expected output looks like what you showed. For context i have 3 product flags total. One opportunity record would have 3 columns: "CLM Flag", "Negotiate Flag", and "Gen Flag", and it would be 1 or 0 based on the SKU combination.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2020 00:13:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-Match-And-function-for-multiple-values/m-p/1719851#M54723</guid>
      <dc:creator>sungyunley</dc:creator>
      <dc:date>2020-06-18T00:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: If Match And function for multiple values</title>
      <link>https://community.qlik.com/t5/App-Development/If-Match-And-function-for-multiple-values/m-p/1719862#M54727</link>
      <description>&lt;P&gt;In that case, my solution might work for you. Can you change this code to your real time and test it? Let me know if you need further help.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2020 02:02:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-Match-And-function-for-multiple-values/m-p/1719862#M54727</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2020-06-18T02:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: If Match And function for multiple values</title>
      <link>https://community.qlik.com/t5/App-Development/If-Match-And-function-for-multiple-values/m-p/1721436#M54877</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;Sorry for the delay. At first glance i thought it worked, but upon inspection it is counting Gen SKUs incorrectly.&amp;nbsp;I added a screenshot for clarity. Ideally if column B and column C = 1, then column D = 1. If Column B = 0 and Column C = 1, then column D = 1. If column B = 1 an column c = 0, then column D = 0&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Qlik ScreenShot 6.23.PNG" style="width: 751px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/36121i4052168091E00FA7/image-size/large?v=v2&amp;amp;px=999" role="button" title="Qlik ScreenShot 6.23.PNG" alt="Qlik ScreenShot 6.23.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 20:23:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-Match-And-function-for-multiple-values/m-p/1721436#M54877</guid>
      <dc:creator>sungyunley</dc:creator>
      <dc:date>2020-06-23T20:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: If Match And function for multiple values</title>
      <link>https://community.qlik.com/t5/App-Development/If-Match-And-function-for-multiple-values/m-p/1721442#M54880</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="QlikSenseCode6.23.PNG" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/36122i111877F09EDD1778/image-size/medium?v=v2&amp;amp;px=400" role="button" title="QlikSenseCode6.23.PNG" alt="QlikSenseCode6.23.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Heres a sshot of my code. I didn't add the 2nd piece you suggested (below) because those specific SKUs dont exist, and there are too many SKUs to hard code to set as an exclude function.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;If(WildMatch(Concat(DISTINCT [Product Code]),'*APT-0529*', '*APT-0544*', '*SCM2*'),0)) As Flag&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 20:34:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-Match-And-function-for-multiple-values/m-p/1721442#M54880</guid>
      <dc:creator>sungyunley</dc:creator>
      <dc:date>2020-06-23T20:34:10Z</dc:date>
    </item>
  </channel>
</rss>

