<?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: Set Expression vs If Statement in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-Expression-vs-If-Statement/m-p/1951057#M78388</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/187905"&gt;@H-Zey&lt;/a&gt;&amp;nbsp; Yes you are right. Between {} it is treated as AND. I would recommend you to study Set Analysis Topic from our Qlik Community which will help you resolve many issues.&lt;/P&gt;
&lt;P&gt;Happy Learning!&lt;/P&gt;</description>
    <pubDate>Sun, 03 Jul 2022 17:16:11 GMT</pubDate>
    <dc:creator>sidhiq91</dc:creator>
    <dc:date>2022-07-03T17:16:11Z</dc:date>
    <item>
      <title>Set Expression vs If Statement</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Expression-vs-If-Statement/m-p/1951012#M78377</link>
      <description>&lt;P&gt;I have a Bar chart with an expression that contains a working if Statement:&lt;/P&gt;
&lt;P&gt;Count(DISTINCT if( (Field_X = Field_A and Field_Y = Field_B and COUNTRY = 'USA' and TYPE = 'Val'),ID) )&lt;/P&gt;
&lt;P&gt;If all the conditions are true I get back a distinct count of IDs.&lt;/P&gt;
&lt;P&gt;I have two questions:&lt;BR /&gt;(1) Can this be re-written using Set Expression?&lt;/P&gt;
&lt;P&gt;I tried re-writing it to the following statement but I'm not getting the correct results. Most likely the use of identifiers and operands are incorrect:&lt;/P&gt;
&lt;P&gt;Count(DISTINCT { &amp;lt;Field_X = Field_A&amp;gt;+$1&amp;lt;Field_Y = Field_B&amp;gt;+$2&amp;lt;COUNTRY = {'USA'}&amp;gt;+$3&amp;lt;TYPE = {'Val'}&amp;gt;&amp;gt;} ID)&lt;/P&gt;
&lt;P&gt;Any help is greatly appreciated&lt;/P&gt;
&lt;P&gt;(2)&amp;nbsp; Is there a difference - performance-wise between the If condition and the set expression or are both the same?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jul 2022 18:42:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Expression-vs-If-Statement/m-p/1951012#M78377</guid>
      <dc:creator>H-Zey</dc:creator>
      <dc:date>2022-07-02T18:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: Set Expression vs If Statement</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Expression-vs-If-Statement/m-p/1951017#M78380</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/187905"&gt;@H-Zey&lt;/a&gt;&amp;nbsp;Yes you can definitely write the above if expression in the form of Set analysis. Please see below.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Count(DISTINCT if( (Field_X = Field_A and Field_Y = Field_B and COUNTRY = 'USA' and TYPE = 'Val'),ID) )&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Can be replaced by&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Count(distinct {&amp;lt;Field_X={'Field_A'},Field_Y={'Field_B'},COUNTRY={'USA'},TYPE={'VAL'}&amp;gt;}ID)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Secondly Set expression are the preferred choice for writing Complex expression that contains if conditions.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this answers your question, kindly like and accept it as your solution.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jul 2022 01:48:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Expression-vs-If-Statement/m-p/1951017#M78380</guid>
      <dc:creator>sidhiq91</dc:creator>
      <dc:date>2022-07-03T01:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: Set Expression vs If Statement</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Expression-vs-If-Statement/m-p/1951054#M78387</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6188"&gt;@sidhiq91&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Yes! it did work - thank you.&amp;nbsp; I see that you combined all the field all into one set inside the '&amp;lt; &amp;gt; ' tags.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is that done to treat it as an And?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Will accept it as the solution&lt;/P&gt;
&lt;P&gt;Thanks again&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jul 2022 16:02:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Expression-vs-If-Statement/m-p/1951054#M78387</guid>
      <dc:creator>H-Zey</dc:creator>
      <dc:date>2022-07-03T16:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: Set Expression vs If Statement</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Expression-vs-If-Statement/m-p/1951057#M78388</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/187905"&gt;@H-Zey&lt;/a&gt;&amp;nbsp; Yes you are right. Between {} it is treated as AND. I would recommend you to study Set Analysis Topic from our Qlik Community which will help you resolve many issues.&lt;/P&gt;
&lt;P&gt;Happy Learning!&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jul 2022 17:16:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Expression-vs-If-Statement/m-p/1951057#M78388</guid>
      <dc:creator>sidhiq91</dc:creator>
      <dc:date>2022-07-03T17:16:11Z</dc:date>
    </item>
  </channel>
</rss>

