<?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 filter on function values within a range in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-filter-on-function-values-within-a-range/m-p/823830#M534568</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;maybe this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;customer={"=avg(margin/amount)&amp;gt;=.0"}*{"=avg(margin/amount)&amp;lt;=.2"}&amp;gt;} amount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: PFA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1.jpg" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/79790_1.jpg" style="height: 272px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Mar 2015 20:27:01 GMT</pubDate>
    <dc:creator>maxgro</dc:creator>
    <dc:date>2015-03-03T20:27:01Z</dc:date>
    <item>
      <title>Set analysis filter on function values within a range</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-filter-on-function-values-within-a-range/m-p/823829#M534567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I am trying to create a bar chart where the bars are the sum of the sales over a subset of entries selected based on the average margin.&amp;nbsp; For example, the data points used are like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;customer&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;margin (gross)&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;amount&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;a&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;a&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;22&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;b&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-7&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;51&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;c&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;c&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;37&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;37&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;c&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;14&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;28&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;d&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;6&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;d&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-10&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;19&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to find the amount summed over the customers with the following attributes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;negative average margin percentage ie. customer b has an average -7/51&lt;/LI&gt;&lt;LI&gt;average margin perc. between 0% and 20%&lt;/LI&gt;&lt;LI&gt;average margin perc. between 20% and 50%&lt;/LI&gt;&lt;LI&gt;average margin perc. &amp;gt;50%&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 1. and 4. ie.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;customer={"=avg(margin/amount)&amp;lt;=0"}&amp;gt;} amount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but all attempts to create a range have failed ie.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({1&amp;lt;customer={"=avg(margin/amount)&amp;gt;=.2"},customer={"=avg(margin/amount)&amp;lt;=.50"}&amp;gt;} amount)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;sum({1&amp;lt;customer={"=avg(margin/amount)&amp;gt;=.2"} AND customer={"=avg(margin/amount)&amp;lt;=.50"}&amp;gt;} amount)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;sum({1&amp;lt;customer={"avg(margin/amount)&amp;gt;=.2, avg(margin/amount)&amp;lt;=.50"}&amp;gt;} amount)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;and many more but I've lost track and am obviously missing one particular version...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Bonus: how do I create a pie chart with this info without coding the margin range into the load statement?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 20:10:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-filter-on-function-values-within-a-range/m-p/823829#M534567</guid>
      <dc:creator />
      <dc:date>2015-03-03T20:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis filter on function values within a range</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-filter-on-function-values-within-a-range/m-p/823830#M534568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;maybe this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;customer={"=avg(margin/amount)&amp;gt;=.0"}*{"=avg(margin/amount)&amp;lt;=.2"}&amp;gt;} amount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: PFA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1.jpg" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/79790_1.jpg" style="height: 272px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 20:27:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-filter-on-function-values-within-a-range/m-p/823830#M534568</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-03-03T20:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis filter on function values within a range</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-filter-on-function-values-within-a-range/m-p/823831#M534569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;see attached&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 20:33:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-filter-on-function-values-within-a-range/m-p/823831#M534569</guid>
      <dc:creator>martinpohl</dc:creator>
      <dc:date>2015-03-03T20:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis filter on function values within a range</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-filter-on-function-values-within-a-range/m-p/823832#M534570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, thanks-this is nice and very close but I need to find customers with average margins in the given buckets as opposed to counting distinct instances.&amp;nbsp; I am trying to modify with the aggr function-I will post above...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 21:16:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-filter-on-function-values-within-a-range/m-p/823832#M534570</guid>
      <dc:creator />
      <dc:date>2015-03-03T21:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis filter on function values within a range</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-filter-on-function-values-within-a-range/m-p/823833#M534571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have now also tried aggregated expressions:&lt;/P&gt;&lt;P&gt;sum(aggr(if(avg(margin/amount)&amp;gt;.2 and avg(margin/amount)&amp;lt;=.45,customer), amount))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which produces wildly large sums.&amp;nbsp; I just don't know how to approach this-calculated dimension, expression, aggregation...can't seem to get anything to return appropriate amounts.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 21:20:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-filter-on-function-values-within-a-range/m-p/823833#M534571</guid>
      <dc:creator />
      <dc:date>2015-03-03T21:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis filter on function values within a range</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-filter-on-function-values-within-a-range/m-p/823834#M534572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Massimo! This 'seems' to work-at least my numbers add up now...I used Year (I have it in my data set) as the dimension and then used your expressions.&amp;nbsp; One question so I can be comfortable with what this is doing:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What does the '*' between sets mean?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 21:41:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-filter-on-function-values-within-a-range/m-p/823834#M534572</guid>
      <dc:creator />
      <dc:date>2015-03-03T21:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis filter on function values within a range</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-filter-on-function-values-within-a-range/m-p/823835#M534573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #555555; font-family: Arial, sans-serif; font-size: 14px;"&gt;* returns the set of records that only belong to the overlapping data from the first and second sets (similar to an INTERSECT in SQL)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 21:45:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-filter-on-function-values-within-a-range/m-p/823835#M534573</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-03T21:45:12Z</dc:date>
    </item>
  </channel>
</rss>

