<?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 condition within set expression on field selected in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-condition-within-set-expression-on-field-selected/m-p/78613#M769170</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;if(match(%_SITEID,'194','201'),&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;count({1&amp;lt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;CALCULATED_SITE_STATUS={"Active"},&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;&amp;gt;} DISTINCT %_SITEID)&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;&lt;A _jive_internal="true" class="jive-acclaim-likelink" data-command="like" data-object-id="1317968" data-object-type="2" href="https://community.qlik.com/thread/269756" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #3778c7;"&gt;If condition in set analysis&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 10 Jun 2018 11:54:32 GMT</pubDate>
    <dc:creator>Chanty4u</dc:creator>
    <dc:date>2018-06-10T11:54:32Z</dc:date>
    <item>
      <title>If condition within set expression on field selected</title>
      <link>https://community.qlik.com/t5/QlikView/If-condition-within-set-expression-on-field-selected/m-p/78610#M769167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Qlik experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had below set expression which provides count as '2'. &lt;/P&gt;&lt;P&gt;It is a set expression ignoring current selections though there is a selection on field %_SITEID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=count({1&amp;lt;&lt;/P&gt;&lt;P&gt;CALCULATED_SITE_STATUS={"Active"},&lt;/P&gt;&lt;P&gt;%_SITEID= {"194","201"}&lt;/P&gt;&lt;P&gt;&amp;gt;} DISTINCT %_SITEID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Same expression with an if clause gives result as '0'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=count({1&amp;lt;&lt;/P&gt;&lt;P&gt;CALCULATED_SITE_STATUS={"Active"},&lt;/P&gt;&lt;P&gt;%_SITEID= {"=if(match(%_SITEID,194,201),1,0)=1"}&lt;/P&gt;&lt;P&gt;&amp;gt;} DISTINCT %_SITEID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any advise how to use an if clause inside set expression and by ignoring current selections though there exists a selection on field used inside set expression if clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-condition-within-set-expression-on-field-selected/m-p/78610#M769167</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: If condition within set expression on field selected</title>
      <link>https://community.qlik.com/t5/QlikView/If-condition-within-set-expression-on-field-selected/m-p/78611#M769168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;store if condition in variable&lt;/P&gt;&lt;P&gt;and then use that in set expression&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Jun 2018 09:23:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-condition-within-set-expression-on-field-selected/m-p/78611#M769168</guid>
      <dc:creator>arvind1494</dc:creator>
      <dc:date>2018-06-10T09:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: If condition within set expression on field selected</title>
      <link>https://community.qlik.com/t5/QlikView/If-condition-within-set-expression-on-field-selected/m-p/78612#M769169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;count({1&amp;lt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;CALCULATED_SITE_STATUS={"Active"},&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;%_SITEID= {"=if(match(%_SITEID,'194','201'),&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;%_SITEID&lt;/SPAN&gt;)"}&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;gt;} DISTINCT %_SITEID)&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Br,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;KC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Jun 2018 09:44:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-condition-within-set-expression-on-field-selected/m-p/78612#M769169</guid>
      <dc:creator>jyothish8807</dc:creator>
      <dc:date>2018-06-10T09:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: If condition within set expression on field selected</title>
      <link>https://community.qlik.com/t5/QlikView/If-condition-within-set-expression-on-field-selected/m-p/78613#M769170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;if(match(%_SITEID,'194','201'),&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;count({1&amp;lt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;CALCULATED_SITE_STATUS={"Active"},&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;&amp;gt;} DISTINCT %_SITEID)&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;&lt;A _jive_internal="true" class="jive-acclaim-likelink" data-command="like" data-object-id="1317968" data-object-type="2" href="https://community.qlik.com/thread/269756" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #3778c7;"&gt;If condition in set analysis&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Jun 2018 11:54:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-condition-within-set-expression-on-field-selected/m-p/78613#M769170</guid>
      <dc:creator>Chanty4u</dc:creator>
      <dc:date>2018-06-10T11:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: If condition within set expression on field selected</title>
      <link>https://community.qlik.com/t5/QlikView/If-condition-within-set-expression-on-field-selected/m-p/78614#M769171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Can you upload some sample data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2018 02:07:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-condition-within-set-expression-on-field-selected/m-p/78614#M769171</guid>
      <dc:creator>qlikviewwizard</dc:creator>
      <dc:date>2018-06-11T02:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: If condition within set expression on field selected</title>
      <link>https://community.qlik.com/t5/QlikView/If-condition-within-set-expression-on-field-selected/m-p/78615#M769172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure I understand, but may be this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Count({1&amp;lt;CALCULATED_SITE_STATUS = {"Active"}, %_SITEID = {"=If(Match(&lt;SPAN style="color: #ff0000;"&gt;Only({1}&lt;/SPAN&gt; %_SITEID&lt;SPAN style="color: #ff0000;"&gt;)&lt;/SPAN&gt;, 194, 201), 1, 0) = 1"}&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;gt;} DISTINCT %_SITEID)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2018 02:16:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-condition-within-set-expression-on-field-selected/m-p/78615#M769172</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-06-11T02:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: If condition within set expression on field selected</title>
      <link>https://community.qlik.com/t5/QlikView/If-condition-within-set-expression-on-field-selected/m-p/78616#M769173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sunny, yes Only{1} inside match did the magic. Thanks.&lt;/P&gt;&lt;P&gt;I have also tried other advises below where the result is not as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;Gives -0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If clause in a variable and use variable in set instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;Gives - 0&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;count({1&amp;lt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;CALCULATED_SITE_STATUS={"Active"},&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;%_SITEID= {"=if(match(%_SITEID,'194','201'),&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;%_SITEID&lt;/SPAN&gt;)"}&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;gt;} DISTINCT %_SITEID)&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="text-decoration: underline;"&gt;Gives - '-'&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;if(match(%_SITEID,'194','201'),&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;count({1&amp;lt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;CALCULATED_SITE_STATUS={"Active"},&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;&amp;gt;} DISTINCT %_SITEID)&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;To provide a view of sample data for others visiting this post -&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;&lt;/P&gt;&lt;P&gt;MYTABLE:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt; *&lt;/P&gt;&lt;P&gt; INLINE&lt;/P&gt;&lt;P&gt; [&lt;/P&gt;&lt;P&gt; %_SITEID,CALCULATED_SITE_STATUS&lt;/P&gt;&lt;P&gt; 194,Active&lt;/P&gt;&lt;P&gt; 201,Active&lt;/P&gt;&lt;P&gt; 205,Active&lt;/P&gt;&lt;P&gt; 206,Active&lt;/P&gt;&lt;P&gt; 212,Inactive&lt;/P&gt;&lt;P&gt; 214,Inactive&lt;/P&gt;&lt;P&gt; ];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 1 : A list box on sheet for %_SITEID&lt;/P&gt;&lt;P&gt;Step2 : Select %_SITEID as 205&lt;/P&gt;&lt;P&gt;Step3: Requirement is to give me count of only records where %_SITEID is 194 or 201 and with CALCULATED_SITE_STATUS as Active though selection of %_SITEID is for 205.&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;It is underlying scenario i was looking for though it is a subset of bigger set query.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Thanks all.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2018 08:47:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-condition-within-set-expression-on-field-selected/m-p/78616#M769173</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-06-11T08:47:34Z</dc:date>
    </item>
  </channel>
</rss>

