<?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 Fractile and average functions in the same expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Fractile-and-average-functions-in-the-same-expression/m-p/198106#M57528</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;it seems it takes top 80% of people disregarding department, but without "total" it does not work:(. Must admit, i did not figure it out it this certain pivot table.&lt;/P&gt;&lt;P&gt;But I think you are mixing two different things - fractile returns values - age, but rank function returns dimensions - employees. These are not exchangeable.&lt;/P&gt;&lt;P&gt;I did not help you, did I:(.&lt;/P&gt;&lt;P&gt;Tomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Apr 2011 12:03:16 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-04-22T12:03:16Z</dc:date>
    <item>
      <title>Fractile and average functions in the same expression</title>
      <link>https://community.qlik.com/t5/QlikView/Fractile-and-average-functions-in-the-same-expression/m-p/198099#M57521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear QV-users.&lt;/P&gt;&lt;P&gt;I hope someone of you out there can help me solving my problem with fractile and average functions in the same expression.&lt;/P&gt;&lt;P&gt;In my enclosed files I have 3 departments named A, B and C and I want to know what the average age is for the 20% oldest employees in each department and the average of all employees.&lt;/P&gt;&lt;P&gt;So far I have made an expression with the 80% fractile but I get an error when I try to combine my fractile function with avg.&lt;/P&gt;&lt;P&gt;In the expression my function is: =fractile(Age, 0.8) so It is possible to see the fractile for each department.&lt;/P&gt;&lt;P&gt;I really hope you can help me solving this.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Johnni&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2011 11:11:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fractile-and-average-functions-in-the-same-expression/m-p/198099#M57521</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-04-05T11:11:32Z</dc:date>
    </item>
    <item>
      <title>Fractile and average functions in the same expression</title>
      <link>https://community.qlik.com/t5/QlikView/Fractile-and-average-functions-in-the-same-expression/m-p/198100#M57522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can some of you guys help me?&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Johnni&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2011 07:10:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fractile-and-average-functions-in-the-same-expression/m-p/198100#M57522</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-04-06T07:10:41Z</dc:date>
    </item>
    <item>
      <title>Fractile and average functions in the same expression</title>
      <link>https://community.qlik.com/t5/QlikView/Fractile-and-average-functions-in-the-same-expression/m-p/198101#M57523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;try using this formula as an expression:&lt;/P&gt;&lt;P&gt;avg( {&amp;lt;employee = {"=rank(sum(-age))&amp;lt;=(count (total employee) *(3/4))"}&amp;gt;} age)&lt;/P&gt;&lt;P&gt;Where in field employee is an identified of employee and age is age:). This formula should calculate average age for lower (thats why there is minus sign in rank function) 75% fractile of employees sorted by age. If you need 80%, simply use 4/5 instead of 3/4 in my example.&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;Tomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2011 08:54:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fractile-and-average-functions-in-the-same-expression/m-p/198101#M57523</guid>
      <dc:creator />
      <dc:date>2011-04-06T08:54:47Z</dc:date>
    </item>
    <item>
      <title>Fractile and average functions in the same expression</title>
      <link>https://community.qlik.com/t5/QlikView/Fractile-and-average-functions-in-the-same-expression/m-p/198102#M57524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tomas,&lt;/P&gt;&lt;P&gt;I tried your solution but it does not give the results I was looking for. I also did the calculations in Excel without expressions.&lt;/P&gt;&lt;P&gt;Maybe it is easier to sort the ages in each department and then calculate the average age on the 20% oldest. But I have no idea how to do that.&lt;/P&gt;&lt;P&gt;If you open the enclosed xlsx-file then you can see that I have grouped the names into three departsments. Each department has its own colour. I have made the sandbox in an easy way:&lt;/P&gt;&lt;P&gt;- 50 employees with unique names grouped into three departments. The average age of the ten oldest employees is 58,9 years.&lt;/P&gt;&lt;P&gt;- Dep. A with 10 employees marked red where the two last employees (light red) are in the 80 % fractile. Their average age is 59 years.&lt;/P&gt;&lt;P&gt;- Dep. B with 15 employees marked yellow where the three last employees (light yellow) are in the 80 % fractile. Their average age is 62,33 years.&lt;/P&gt;&lt;P&gt;- Dep. C with 25 employees marked green where the five last employees (light green) are in the 80 % fractile. Their average age is 55 years.&lt;/P&gt;&lt;P&gt;Johnni&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Apr 2011 10:08:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fractile-and-average-functions-in-the-same-expression/m-p/198102#M57524</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-04-07T10:08:53Z</dc:date>
    </item>
    <item>
      <title>Fractile and average functions in the same expression</title>
      <link>https://community.qlik.com/t5/QlikView/Fractile-and-average-functions-in-the-same-expression/m-p/198103#M57525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;can you post your qvw file here? You did not write what's wrong with my formula - it does not work at all, or there are just different numbers - how they differ from your expectance?&lt;/P&gt;&lt;P&gt;Answer to this type of questions is usually rank function, you can make some experiments with it.&lt;/P&gt;&lt;P&gt;Otherwise you can prepare average age numbers in script, but you should take extra care when sorting values.&lt;/P&gt;&lt;P&gt;Tomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2011 09:04:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fractile-and-average-functions-in-the-same-expression/m-p/198103#M57525</guid>
      <dc:creator />
      <dc:date>2011-04-11T09:04:32Z</dc:date>
    </item>
    <item>
      <title>Fractile and average functions in the same expression</title>
      <link>https://community.qlik.com/t5/QlikView/Fractile-and-average-functions-in-the-same-expression/m-p/198104#M57526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;now I have posted the qvw file. I have made some calculation on 80% fractile with and without "Total" included in the expressions.&lt;/P&gt;&lt;P&gt;Furthermore I have made two expressions of your suggestion. The first where i changed 3/4 to 4/5 and the second where I did the same but also replaced "employee" with "Name".&lt;/P&gt;&lt;P&gt;Some of the results differ quite a bit from my expectations. The results should be (almost) as I wrote in my previous post.&lt;/P&gt;&lt;P&gt;Thank you for helping me.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Johnni&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2011 09:27:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fractile-and-average-functions-in-the-same-expression/m-p/198104#M57526</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-04-11T09:27:29Z</dc:date>
    </item>
    <item>
      <title>Fractile and average functions in the same expression</title>
      <link>https://community.qlik.com/t5/QlikView/Fractile-and-average-functions-in-the-same-expression/m-p/198105#M57527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oops. Forgot to add the qvw file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2011 09:28:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fractile-and-average-functions-in-the-same-expression/m-p/198105#M57527</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-04-11T09:28:40Z</dc:date>
    </item>
    <item>
      <title>Fractile and average functions in the same expression</title>
      <link>https://community.qlik.com/t5/QlikView/Fractile-and-average-functions-in-the-same-expression/m-p/198106#M57528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;it seems it takes top 80% of people disregarding department, but without "total" it does not work:(. Must admit, i did not figure it out it this certain pivot table.&lt;/P&gt;&lt;P&gt;But I think you are mixing two different things - fractile returns values - age, but rank function returns dimensions - employees. These are not exchangeable.&lt;/P&gt;&lt;P&gt;I did not help you, did I:(.&lt;/P&gt;&lt;P&gt;Tomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Apr 2011 12:03:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fractile-and-average-functions-in-the-same-expression/m-p/198106#M57528</guid>
      <dc:creator />
      <dc:date>2011-04-22T12:03:16Z</dc:date>
    </item>
  </channel>
</rss>

