<?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 question in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-expression-question/m-p/1041160#M931985</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Lyon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you mentioned your given below expression is working fine, it means &lt;STRONG&gt;trade_num&lt;/STRONG&gt; have count more than or equal to 2 therefore, you are getting result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;=if(count({$} DISTINCT trade_num)&amp;gt;=2, count({$}DISTINCT trade_num))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please make sure in your expression no. 2 field values, either field &lt;STRONG&gt;trade_num_alt&lt;/STRONG&gt; has more than 2 counts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Ishfaque Ahmed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Mar 2016 03:52:53 GMT</pubDate>
    <dc:creator>engishfaque</dc:creator>
    <dc:date>2016-03-10T03:52:53Z</dc:date>
    <item>
      <title>Set expression question</title>
      <link>https://community.qlik.com/t5/QlikView/Set-expression-question/m-p/1041158#M931983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there, &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I am a relative newbie to QlikView and am struggling with a set expression.&amp;nbsp; I have a chart with 4 data fields, which are traits on products that are bought and sold by us.&amp;nbsp;&amp;nbsp; Based on those fields, I want to count the number of total transactions, as well as purchases and sales.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Each transaction has a trade number (trade_num) and buy/sell indicator&amp;nbsp; (bs_ind), neither of which are one one of the 4 trait fields.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;In the end, I am looking set of traits where there are multiple transaction for the set of traits, including at least one buy AND one sale.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Total Records, this expression seems to work fine:&lt;/P&gt;&lt;P&gt;=if(count({$} DISTINCT trade_num)&amp;gt;=2, count({$}DISTINCT trade_num)) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I want to narrow down to records where I have both at least one buy AND one sell I am having trouble.&amp;nbsp; I cannot even get the buy count correct.&amp;nbsp; Why is this expression not working?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(count({$} DISTINCT trade_num_alt)&amp;gt;2, count({$&amp;lt;[bs_ind]={'B'}&amp;gt;}DISTINCT trade_num_alt),0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance for any help!&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/Set-expression-question/m-p/1041158#M931983</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Set expression question</title>
      <link>https://community.qlik.com/t5/QlikView/Set-expression-question/m-p/1041159#M931984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try creating a new expression -&amp;gt; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;count({$} DISTINCT trade_num_alt)&lt;/STRONG&gt; and check if it is ever greater than 2? if it isn't then the above expression will always be equal to 0. If it does, then try &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;count({$&amp;lt;[bs_ind]={'B'}&amp;gt;}DISTINCT trade_num_alt)&lt;/STRONG&gt; and see if this is getting to be 0&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Mar 2016 21:39:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-expression-question/m-p/1041159#M931984</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-03-09T21:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: Set expression question</title>
      <link>https://community.qlik.com/t5/QlikView/Set-expression-question/m-p/1041160#M931985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Lyon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you mentioned your given below expression is working fine, it means &lt;STRONG&gt;trade_num&lt;/STRONG&gt; have count more than or equal to 2 therefore, you are getting result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;=if(count({$} DISTINCT trade_num)&amp;gt;=2, count({$}DISTINCT trade_num))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please make sure in your expression no. 2 field values, either field &lt;STRONG&gt;trade_num_alt&lt;/STRONG&gt; has more than 2 counts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Ishfaque Ahmed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Mar 2016 03:52:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-expression-question/m-p/1041160#M931985</guid>
      <dc:creator>engishfaque</dc:creator>
      <dc:date>2016-03-10T03:52:53Z</dc:date>
    </item>
  </channel>
</rss>

