<?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: Expression with set analysis equivalent to Sum in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expression-with-set-analysis-equivalent-to-Sum/m-p/1124627#M462639</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It works. Could you explain me why &lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;{"=Len(Trim([CC]))=0 or &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Len(Trim([DC]))=0"} &lt;/STRONG&gt;is assigned to Order?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Set analysis syntax is sometimes a bit difficult to understand.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case, Do you know which expression is more efficient in terms of performance, Sum or Count? or they are same?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 31 Aug 2016 23:53:10 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-08-31T23:53:10Z</dc:date>
    <item>
      <title>Expression with set analysis equivalent to Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-with-set-analysis-equivalent-to-Sum/m-p/1124625#M462637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have below expression working perfectly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum({$&amp;lt;[Order Type]={'A'}&amp;gt;} if(Len(Trim([CC]))=0 OR Len(Trim([DD]))=0, 1, 0))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and I would like to obtain the same result using Count in combination with set analysis, so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Count({$&amp;lt;[Order Type]={'A'},[CC]={"=Len(Trim([CC]))=0"}&lt;STRONG&gt;&amp;gt;+&amp;lt;&lt;/STRONG&gt;[DC]={"=Len(Trim([DC]))=0"} &amp;gt;}Order)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But Count is not returning same result as Sum. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The correct result is the one returned by Sum. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2016 15:24:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-with-set-analysis-equivalent-to-Sum/m-p/1124625#M462637</guid>
      <dc:creator />
      <dc:date>2016-08-31T15:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: Expression with set analysis equivalent to Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-with-set-analysis-equivalent-to-Sum/m-p/1124626#M462638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this:&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;"&gt;&lt;STRONG&gt;=Count({$&amp;lt;[Order Type]={'A'}, Order = {"=Len(Trim([CC]))=0 or &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;Len(Trim([DC]))=0"}&amp;gt;} Order)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2016 15:27:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-with-set-analysis-equivalent-to-Sum/m-p/1124626#M462638</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-08-31T15:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Expression with set analysis equivalent to Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-with-set-analysis-equivalent-to-Sum/m-p/1124627#M462639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It works. Could you explain me why &lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;{"=Len(Trim([CC]))=0 or &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Len(Trim([DC]))=0"} &lt;/STRONG&gt;is assigned to Order?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Set analysis syntax is sometimes a bit difficult to understand.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case, Do you know which expression is more efficient in terms of performance, Sum or Count? or they are same?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2016 23:53:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-with-set-analysis-equivalent-to-Sum/m-p/1124627#M462639</guid>
      <dc:creator />
      <dc:date>2016-08-31T23:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: Expression with set analysis equivalent to Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-with-set-analysis-equivalent-to-Sum/m-p/1124628#M462640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So this way of using set analysis is known as search string. The best way to see this is to create a straight table with Order as dimension and &lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;=Len(Trim([CC]))=0 or &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Len(Trim([DC]))=0&lt;/STRONG&gt; as expression. All those places where you see -1 showing for a particular order, those rows will be included in the expression. This can of search string can only be done if your straight table have only one dimension, if you somehow need to add 2 fields to get the right true, false, then this search string technique won't work unless you create a concatenated key of the two fields involved to get the right information in the straight table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have not done a great job of explaining this, because it is somewhat difficult for me to explain this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To answer your second question, I think set analysis technique might be relatively better than if. But I have not done enough testing to confirm it &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2016 02:46:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-with-set-analysis-equivalent-to-Sum/m-p/1124628#M462640</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-09-01T02:46:24Z</dc:date>
    </item>
  </channel>
</rss>

