<?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 with Aggr and formula in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Aggr-and-formula/m-p/302108#M497507</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since the data is in preaggregated form I cannot confirm the result but the following expression should do the job.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;=sum(Aggr(Avg({&amp;lt;tenure={"&amp;lt;62"}&amp;gt;} active_pct)-2*Stdev({&amp;lt;tenure={"&amp;lt;62"}&amp;gt;} active_pct),tenure))&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you try. If not worked out please share the actual data and I shall work it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Nov 2011 18:15:40 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-11-08T18:15:40Z</dc:date>
    <item>
      <title>Set Analysis with Aggr and formula</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Aggr-and-formula/m-p/302105#M497504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am starting with this Set Analysis using Aggr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;tenure = {"&amp;lt;61"}&amp;gt;}(aggr(avg({&amp;lt;tenure = {"&amp;lt;61"}&amp;gt;}active_pct),tenure)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works fine. Now I am trying to replace active_pct with the formula&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;avg(active_pct) - (2 * Stdev(active_pct)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried the followiong that do not work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;tenure = {"&amp;lt;61"}&amp;gt;}(aggr(avg({&amp;lt;tenure = {"&amp;lt;61"}&amp;gt;}&lt;STRONG&gt;&lt;EM&gt; (avg(activ_pct) - (2*Stdeve(active_pct))&lt;/EM&gt;)&lt;/STRONG&gt;),tenure)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;tenure = {"&amp;lt;61"}&amp;gt;}(aggr(avg({&amp;lt;tenure = {"&amp;lt;61"&amp;gt;}active_pct),tenure))) - (2 * Stdev({&amp;lt;tenure = {"&amp;lt;61"}&amp;gt;}(aggr(avg({&amp;lt;tenure = {"&amp;lt;61"&amp;gt;}active_pct),tenure))) - This one is subtracting at too high of a level, I need the subtraction before the aggregation.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried to create a variable for the formula so I can just plug the variabe into the set analysis, but I can't get the variable to work, the variable always totals instead of giving a value for each individual tenure value.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to break this down to ensure the individual pieces work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using avg(active_pct) - (2 * Stdev(active_pct) if I total by Sum of Rows I get the correct number if I select tenure value of 1 - 60&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;﻿﻿&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Nov 2011 19:44:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Aggr-and-formula/m-p/302105#M497504</guid>
      <dc:creator />
      <dc:date>2011-11-07T19:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with Aggr and formula</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Aggr-and-formula/m-p/302106#M497505</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;Your expression: sum({&amp;lt;tenure = {"&amp;lt;61"}&amp;gt;}(aggr(avg({&amp;lt;tenure = {"&amp;lt;61"}&amp;gt;}active_pct),tenure))) and sum( aggr(avg({&amp;lt;tenure = {"&amp;lt;61"}&amp;gt;} active_pct),tenure)) are same. No need to have same set twice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Now I am trying to replace active_pct with the formula&lt;BR /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;since avg is a group function having it instead of active_pct doesnt make sense to me. I think what you are looking for is something like a group by clause in SQL. For this you need to try TOTAL keyword.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can give an excel with the data and expected result (with excel formula) we can help you breaking it down.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2011 01:50:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Aggr-and-formula/m-p/302106#M497505</guid>
      <dc:creator />
      <dc:date>2011-11-08T01:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with Aggr and formula</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Aggr-and-formula/m-p/302107#M497506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I remove either set in the formula it does not work.&amp;nbsp; I thought this was strange as well, but it only works with both sets.&amp;nbsp; I saw something in another post about using it twice when using aggr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached a file which has two tables, one is in excel with the number we are trying to get (35.9198), the other is a table from QLK.&amp;nbsp; The avg(active_pct) - (2 * stdev(active_pct)) column has the total mode set to sum of rows.&amp;nbsp; This total (35.9198) is what we are looking for.&amp;nbsp; The current selections are set to tenure &amp;lt; 61, which corresponds to what I am trying to use set analysis for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2011 14:09:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Aggr-and-formula/m-p/302107#M497506</guid>
      <dc:creator />
      <dc:date>2011-11-08T14:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with Aggr and formula</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Aggr-and-formula/m-p/302108#M497507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since the data is in preaggregated form I cannot confirm the result but the following expression should do the job.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;=sum(Aggr(Avg({&amp;lt;tenure={"&amp;lt;62"}&amp;gt;} active_pct)-2*Stdev({&amp;lt;tenure={"&amp;lt;62"}&amp;gt;} active_pct),tenure))&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you try. If not worked out please share the actual data and I shall work it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2011 18:15:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Aggr-and-formula/m-p/302108#M497507</guid>
      <dc:creator />
      <dc:date>2011-11-08T18:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with Aggr and formula</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Aggr-and-formula/m-p/302109#M497508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thank You for your replies.&amp;nbsp; That formula will work only if I choose the current selection to be tenure = &amp;lt;61.&amp;nbsp; So the set is not working correctly.&amp;nbsp; I will post the data shortly. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2011 18:40:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Aggr-and-formula/m-p/302109#M497508</guid>
      <dc:creator />
      <dc:date>2011-11-08T18:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with Aggr and formula</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Aggr-and-formula/m-p/302110#M497509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Data attached&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2011 19:10:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Aggr-and-formula/m-p/302110#M497509</guid>
      <dc:creator />
      <dc:date>2011-11-08T19:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with Aggr and formula</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Aggr-and-formula/m-p/302111#M497510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please find the updated qvw with a text box with brown background.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems to work for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;With Selections:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="With Selections.PNG" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/8522_With+Selections.PNG" style="display: block; margin-left: auto; margin-right: auto;" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Without Selections:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Without Selections.PNG" class="jive-image" src="https://community.qlik.com/legacyfs/online/8521_Without+Selections.PNG" style="display: block; margin-left: auto; margin-right: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2011 19:23:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Aggr-and-formula/m-p/302111#M497510</guid>
      <dc:creator />
      <dc:date>2011-11-08T19:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with Aggr and formula</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Aggr-and-formula/m-p/302112#M497511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; If I selelct a tenure it changes the value.&amp;nbsp; Shouldn't set analysis stay the same no matter what the current selections are?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2011 19:27:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Aggr-and-formula/m-p/302112#M497511</guid>
      <dc:creator />
      <dc:date>2011-11-08T19:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with Aggr and formula</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Aggr-and-formula/m-p/302113#M497512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Done.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/8524_Capture.PNG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2011 19:34:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Aggr-and-formula/m-p/302113#M497512</guid>
      <dc:creator />
      <dc:date>2011-11-08T19:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with Aggr and formula</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Aggr-and-formula/m-p/302114#M497513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great, Thank you, that works.&amp;nbsp; What does the {1} at the beginning do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to add (* avg(pct_bal) onto the equation to make it (avg(act_pct) - 2 *(Stdev(act_pct))) * avg(pct_bal)&lt;/P&gt;&lt;P&gt;aggregated sum with set analysis&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying this:&lt;/P&gt;&lt;P&gt;=sum({1} Aggr(Avg({&amp;lt;tenure={"&amp;lt;61"}&amp;gt;} active_pct) - 2 * Stdev({&amp;lt;tenure={"&amp;lt;61"}&amp;gt;} active_pct) * (Avg({&amp;lt;tenure={"&amp;lt;61"}&amp;gt;} pct_bal)), tenure)) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but its not working, any ideas?&amp;nbsp; I attached the data for reference.&lt;/P&gt;&lt;P&gt;﻿&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2011 20:56:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Aggr-and-formula/m-p/302114#M497513</guid>
      <dc:creator />
      <dc:date>2011-11-08T20:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with Aggr and formula</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Aggr-and-formula/m-p/302115#M497514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;{1} ignores all selections made for that calculation. For more information read set analysis in qv help. Some parathesis error. Fixed in the attachment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2011 05:07:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Aggr-and-formula/m-p/302115#M497514</guid>
      <dc:creator />
      <dc:date>2011-11-09T05:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with Aggr and formula</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Aggr-and-formula/m-p/302116#M497515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thank You&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2011 13:49:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Aggr-and-formula/m-p/302116#M497515</guid>
      <dc:creator />
      <dc:date>2011-11-09T13:49:32Z</dc:date>
    </item>
  </channel>
</rss>

