<?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: Possible Set Analysis Question in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Possible-Set-Analysis-Question/m-p/862650#M301914</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it seems to me you could solve with the aggr function&lt;/P&gt;&lt;P&gt;sum(aggr(yourexpression, [Part Number]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlikview.com/docs/DOC-3857" title="https://community.qlikview.com/docs/DOC-3857"&gt;https://community.qlikview.com/docs/DOC-3857&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 19 Apr 2015 06:12:38 GMT</pubDate>
    <dc:creator>maxgro</dc:creator>
    <dc:date>2015-04-19T06:12:38Z</dc:date>
    <item>
      <title>Possible Set Analysis Question</title>
      <link>https://community.qlik.com/t5/QlikView/Possible-Set-Analysis-Question/m-p/862649#M301913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to write an expression that looks at the # of returns and the # of sales for each part number, then calculate the sum only if the difference is &amp;gt;0.&amp;nbsp; I also have a column indicating if it is a return or a sale.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can get it to work when the part number is a dimension by using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(Sum({&amp;lt; [CR] = {'CR'} &amp;gt;} [Qty])-Sum({&amp;lt; [CR] = {'Sales'} &amp;gt;} [Qty])&amp;gt;0,Sum({&amp;lt; [CR] = {'CR'} &amp;gt;} [Qty])-Sum({&amp;lt; [CR] = {'Sales'} &amp;gt;} [Qty]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;(CR is the column that identifies if the record/row is a [CR]Return or [Sales]Sale.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&amp;nbsp; If part xxx had 5 returns, 10 sales, the difference would be -5.&amp;nbsp; I need this to be omitted from the overall total.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If part yyy had 10 returns, 5 sales, then the difference would be 5.&amp;nbsp; I need this to be included in the overall sum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't get an overall sum of the records that are &amp;gt;0 without including the part number as a dimension.&amp;nbsp; It gives me a sum, but adds all of the returns and sales, then subtracts the sales from returns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've worked with this for quite some time, inserting [Part number] hoping it would perform the calculation for each row.&amp;nbsp; It simply sums both categories (CR and Sales) and gives me the difference.&lt;/P&gt;&lt;P&gt;=if(Sum({&amp;lt; [Part Number] = ,[CR] = {'CR'} &amp;gt;} [Qty])-Sum({&amp;lt; [Part Number] = ,[CR] = {'Sales'} &amp;gt;} [Qty])&amp;gt;0,Sum({&amp;lt; [CR] = {'CR'} &amp;gt;} [Qty])-Sum({&amp;lt; [CR] = {'Sales'} &amp;gt;} [Qty]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I get an expression to work with each record/row without using a dimension, then include only the records/rows that meet the criteria in another expression?&amp;nbsp; What am I missing or doing wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Apr 2015 05:06:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Possible-Set-Analysis-Question/m-p/862649#M301913</guid>
      <dc:creator>jcampbell474</dc:creator>
      <dc:date>2015-04-19T05:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Possible Set Analysis Question</title>
      <link>https://community.qlik.com/t5/QlikView/Possible-Set-Analysis-Question/m-p/862650#M301914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it seems to me you could solve with the aggr function&lt;/P&gt;&lt;P&gt;sum(aggr(yourexpression, [Part Number]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlikview.com/docs/DOC-3857" title="https://community.qlikview.com/docs/DOC-3857"&gt;https://community.qlikview.com/docs/DOC-3857&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Apr 2015 06:12:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Possible-Set-Analysis-Question/m-p/862650#M301914</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-04-19T06:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: Possible Set Analysis Question</title>
      <link>https://community.qlik.com/t5/QlikView/Possible-Set-Analysis-Question/m-p/862651#M301915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Massimo.&amp;nbsp; It feels like this is the solution.&amp;nbsp; At the same time, I cannot get it to work.&amp;nbsp; Does the syntax look correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(aggr(Sum({&amp;lt; [Part Number] = ,[CR] = {'CR'} &amp;gt;} [Qty])-Sum({&amp;lt; [Part Number] = ,[CR] = {'Sales'} &amp;gt;} [Qty])&amp;gt;0,Sum({&amp;lt; [CR] = {'CR'} &amp;gt;} [Qty])-Sum({&amp;lt; [CR] = {'Sales'} &amp;gt;} [Qty]), [Part Number]))&amp;nbsp; does not provide a sum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(aggr(Sum({&amp;lt; [Part Number] = ,[CR] = {'CR'} &amp;gt;} [Qty])-Sum({&amp;lt; [Part Number] = ,[CR] = {'Sales'} &amp;gt;} [Qty])&amp;gt;0, [Part Number])) gives me a sum, but it is much lower than what it should be.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Apr 2015 13:11:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Possible-Set-Analysis-Question/m-p/862651#M301915</guid>
      <dc:creator>jcampbell474</dc:creator>
      <dc:date>2015-04-19T13:11:00Z</dc:date>
    </item>
  </channel>
</rss>

