<?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 Analysis Sum question in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Sum-question/m-p/665646#M1061912</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may need an advanced aggregation expression, before guessing can you supply a sample QVW or some data&amp;nbsp;&amp;nbsp; w/ explanation ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Oct 2014 15:07:30 GMT</pubDate>
    <dc:creator>JonnyPoole</dc:creator>
    <dc:date>2014-10-06T15:07:30Z</dc:date>
    <item>
      <title>Set Analysis Sum question</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Sum-question/m-p/665645#M1061911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I'm having trouble getting my set analysis query to work for a certain variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'm trying to do is show how many sales we've made at a loss and how many at a profit. This has been relatively easy for volume, sales and margin as I've just used the expression:&lt;/P&gt;&lt;P&gt;=Sum({$&amp;lt;Gross_Margin={"&amp;lt;$(=0)"}&amp;gt;} transaction_quantity)&lt;/P&gt;&lt;P&gt;(or some other version of the formula for profit making products)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I'm having trouble when I'm looking at SKU count. If I use the same formula as above for SKU count:&lt;/P&gt;&lt;P&gt;=count({$&amp;lt;Gross_Margin ={"&amp;lt;$(=0)"}&amp;gt;} DISTINCT Teva_SKU_Current)&lt;/P&gt;&lt;P&gt;For loss making products and:&lt;/P&gt;&lt;P&gt;=count({$&amp;lt;Gross_Margin ={"&amp;gt;=$(=0)"}&amp;gt;} DISTINCT Teva_SKU_Current)&lt;/P&gt;&lt;P&gt;for profit making products then the graph seems to double count products if one customer purchased them at a profit and another at a loss. I think I somehow need to get the formula to look at the total Gross_Margin figure rather than at an individual basis but I'm not sure how to do that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 14:36:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Sum-question/m-p/665645#M1061911</guid>
      <dc:creator />
      <dc:date>2014-10-06T14:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Sum question</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Sum-question/m-p/665646#M1061912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may need an advanced aggregation expression, before guessing can you supply a sample QVW or some data&amp;nbsp;&amp;nbsp; w/ explanation ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 15:07:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Sum-question/m-p/665646#M1061912</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2014-10-06T15:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Sum question</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Sum-question/m-p/665647#M1061913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello there,&lt;/P&gt;&lt;P&gt;without seeing a sample I am just guessing here, but in your formula you have Count if gross margin =0, and your second formula Count if Greater than or equal. My guess is '0' is being double counted on both formulas.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 20:58:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Sum-question/m-p/665647#M1061913</guid>
      <dc:creator />
      <dc:date>2014-10-06T20:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Sum question</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Sum-question/m-p/665648#M1061914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;create separate fields&amp;nbsp; as flags for each condition and then count the values&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and again as mentioned by others .. if you provide some sample data/ sample qvw, it would be easy for us to help you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sri1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 21:16:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Sum-question/m-p/665648#M1061914</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-06T21:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Sum question</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Sum-question/m-p/665649#M1061915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you try the following (and if not working, please provide an example QVW):&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;=count({&amp;lt;Teva_SKU_Current = {"=Sum(Gross_Margin)&amp;lt;=0"}&amp;gt;} DISTINCT Teva_SKU_Current)&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 22:33:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Sum-question/m-p/665649#M1061915</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-06T22:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Sum question</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Sum-question/m-p/665650#M1061916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, so I've attached an example csv of the type of data that I mean. If you look there are three distinct SKU_Current codes (a, b and c) but because the c code is both profitable and making a loss (due to being priced differently depending on the customer) then when I use the following expressions then it is counted as a profitable and a loss-making product when really it should be loss making (5 - 10 = -5).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the moment I am using the following expressions:&lt;/P&gt;&lt;P&gt;=count({$&amp;lt;Gross_Margin ={"&amp;lt;$(=0)"}&amp;gt;} DISTINCT SKU_Current)&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;=count({$&amp;lt;Gross_Margin ={"&amp;lt;=$(=0)"}&amp;gt;} DISTINCT SKU_Current)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="310"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="19" width="94"&gt;SKU_Current&lt;/TD&gt;&lt;TD width="72"&gt;transation_quantity&lt;/TD&gt;&lt;TD width="72"&gt;Gross_Sales&lt;/TD&gt;&lt;TD width="72"&gt;Gross_Margin&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="19"&gt;a&lt;/TD&gt;&lt;TD align="right"&gt;4&lt;/TD&gt;&lt;TD align="right"&gt;10&lt;/TD&gt;&lt;TD align="right"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="19"&gt;b&lt;/TD&gt;&lt;TD align="right"&gt;6&lt;/TD&gt;&lt;TD align="right"&gt;2&lt;/TD&gt;&lt;TD align="right"&gt;-2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="19"&gt;c&lt;/TD&gt;&lt;TD align="right"&gt;10&lt;/TD&gt;&lt;TD align="right"&gt;15&lt;/TD&gt;&lt;TD align="right"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="19"&gt;c&lt;/TD&gt;&lt;TD align="right"&gt;3&lt;/TD&gt;&lt;TD align="right"&gt;3&lt;/TD&gt;&lt;TD align="right"&gt;-10&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2014 15:03:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Sum-question/m-p/665650#M1061916</guid>
      <dc:creator />
      <dc:date>2014-10-08T15:03:39Z</dc:date>
    </item>
  </channel>
</rss>

