<?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 Avg () function with percentile in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Avg-function-with-percentile/m-p/162931#M36266</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the simple version won't work for you, then you're going to need to use Aggr(). Aggr() is a complex, but powerful function. First, you'll need your working Makup expression. Could you post that? Then you will need the dimensions that you will be aggregating across. This is where is gets difficult. It sounds like Month may be a requirement and you usually want anything that is a dimension in your chart. Which dimensions you need in the Aggr() function really depends on your dataset. It's difficult to troubleshoot this one without seeing the structure of the data.&lt;/P&gt;&lt;P&gt;The basic setup for your Aggr() function will be:&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Avg(Aggr(Makup Expressions Here, Dimension1, Dimension2, Dimension3....))&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;You need at least one Dimension, but can use as many as you need. Without a sample to go by, it's going to be difficult to give a more precise answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Oct 2010 15:31:41 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-10-28T15:31:41Z</dc:date>
    <item>
      <title>Avg () function with percentile</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-function-with-percentile/m-p/162928#M36263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm with a difficulty that I counldn't solve myself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At a finantial analysis we have a metric called Makup that it's basically &lt;STRONG&gt;&lt;I&gt;Expenses + Taxes / Incomes&lt;/I&gt;&lt;/STRONG&gt;. This one I got it, but we need to know the average markup until now and that's when my problem begin.&lt;/P&gt;&lt;P&gt;The avg () function doesn't work.&lt;/P&gt;&lt;P&gt;I tried to do it manually (sum every result and divide by the number os months we have) but it's still gets no results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt; sum&lt;BR /&gt;/*expenses*/&lt;BR /&gt;(sum ({&amp;lt;grup_neg = {'Custo Fixo'}&amp;gt; } valor ) *-1&lt;BR /&gt;/*taxes*/&lt;BR /&gt;((sum ({&amp;lt;grp_conta = {'Impostos s/receita'}&amp;gt;} valor)&lt;BR /&gt;+&lt;BR /&gt;sum ({&amp;lt;grp_conta = {'Despesa'}, grup_neg = {'Impostos'}&amp;gt;} valor)) *-1)&lt;BR /&gt;/&lt;BR /&gt;/*Incomes*/&lt;BR /&gt;sum ({&amp;lt;grp_conta = {'Receita'}, prevXfat = {'REALIZADO'}&amp;gt; } valor ) *-1)&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Could anyone help me? What am I doing wrong?&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Leandra Scordamaglia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Oct 2010 14:13:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-function-with-percentile/m-p/162928#M36263</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-10-28T14:13:53Z</dc:date>
    </item>
    <item>
      <title>Avg () function with percentile</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-function-with-percentile/m-p/162929#M36264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can't do nested aggregates [Sum(Sum(Sales))] without the Aggr() function.&lt;/P&gt;&lt;P&gt;Do you need the Sum around everything? Also, why are you multiplying the numerator and denomonator by -1? If you do a little algebra on that expression, the negative ones cancel out, so I believe you should be able to get rid of them. Also, there is no operator between the expenses and taxes on your expression. The lack of an operator and nested aggregates are the reason you're not getting any values.&lt;/P&gt;&lt;P&gt;You should be able to do (simplified):&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;(Sum(Expenses) + Sum(Taxes)) / Sum(Incomes)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;Replace the Sum() with the actual expressions for each. &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Oct 2010 14:58:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-function-with-percentile/m-p/162929#M36264</guid>
      <dc:creator />
      <dc:date>2010-10-28T14:58:03Z</dc:date>
    </item>
    <item>
      <title>Avg () function with percentile</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-function-with-percentile/m-p/162930#M36265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, i got your point.&lt;/P&gt;&lt;P&gt;I need to sum everything because I have some restrictions to get the values and it's not a only value its several values thats composes the result, for example I have several expenses in january and a have to sum all of them to get the total expenses of january.&lt;/P&gt;&lt;P&gt;And how to do the avg() function in this case?&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Oct 2010 15:13:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-function-with-percentile/m-p/162930#M36265</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-10-28T15:13:45Z</dc:date>
    </item>
    <item>
      <title>Avg () function with percentile</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-function-with-percentile/m-p/162931#M36266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the simple version won't work for you, then you're going to need to use Aggr(). Aggr() is a complex, but powerful function. First, you'll need your working Makup expression. Could you post that? Then you will need the dimensions that you will be aggregating across. This is where is gets difficult. It sounds like Month may be a requirement and you usually want anything that is a dimension in your chart. Which dimensions you need in the Aggr() function really depends on your dataset. It's difficult to troubleshoot this one without seeing the structure of the data.&lt;/P&gt;&lt;P&gt;The basic setup for your Aggr() function will be:&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Avg(Aggr(Makup Expressions Here, Dimension1, Dimension2, Dimension3....))&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;You need at least one Dimension, but can use as many as you need. Without a sample to go by, it's going to be difficult to give a more precise answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Oct 2010 15:31:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-function-with-percentile/m-p/162931#M36266</guid>
      <dc:creator />
      <dc:date>2010-10-28T15:31:41Z</dc:date>
    </item>
  </channel>
</rss>

