<?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: avg Age in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/avg-Age/m-p/1446055#M610168</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What happens when you wrap your expression around with Avg?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Avg(Aggr(Avg(Age), Customer, Order, $(=vSelectedDim)))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't understand the usage of &lt;SPAN lang="EN-GB" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;'&amp;amp;&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;$(vSelectedDim)&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;amp;')' in your expression. Since I don't know what that is doing, I am proposing to add something else... but this may not be perfect based on your field names with spaces and multiple selections etc&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Dec 2017 17:34:52 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2017-12-07T17:34:52Z</dc:date>
    <item>
      <title>avg Age</title>
      <link>https://community.qlik.com/t5/QlikView/avg-Age/m-p/1446054#M610167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we got the task to calculate the avg age of our customers in a table regarding ad hoc dimension and dynamic time-periods.&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-GB"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-GB"&gt;now we have to calulate in these steps:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-GB"&gt;&lt;BR /&gt;&lt;/SPAN&gt;1.&lt;SPAN lang="EN-GB"&gt;We have the age &lt;/SPAN&gt;of a single customer per order :&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;customer1: 49+50+50 (men)&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;customer2: 32+32&amp;nbsp; (men)&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;customer3: 43+43+44 (women)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;SPAN lang="EN-GB" style="font-size: 9pt; color: gray;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;We put our dimensions-selections in following ad-hoc dimension:&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;EM&gt;&lt;SPAN lang="EN-GB" style="font-size: 9pt; color: gray;"&gt;vSelectedDim&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-GB" style="font-size: 9pt; color: blue;"&gt; &lt;/SPAN&gt;&lt;SPAN lang="EN-GB"&gt; = &lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9pt; color: blue;"&gt;GetFieldSelections&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9pt; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9pt; color: maroon;"&gt;_dimensionname&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9pt; color: black;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Then we want to aggratage this age for the selected timeperiod and ad hoc-dimensions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;customer1: (49+50+50)/3 =&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 49,67&lt;/P&gt;&lt;P&gt;customer2: (32+32)/2 =&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 32,0&lt;/P&gt;&lt;P&gt;customer3: (43+43+44)/3 =&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 43,33&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-GB"&gt;what works for us is:&lt;BR /&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;EM&gt;&lt;SPAN lang="EN-GB" style="font-size: 9pt; color: gray;"&gt;vAge&lt;SPAN style="color: #0000ff; font-size: 12px;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-GB"&gt;&lt;SPAN lang="EN-GB"&gt;=&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-GB"&gt;&lt;SPAN lang="EN-GB"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-GB"&gt; 'aggr(avg([Age]),Customer, Order, '&amp;amp;&lt;/SPAN&gt;&lt;SPAN lang="EN-GB"&gt;$(vSelectedDim)&lt;/SPAN&gt;&lt;SPAN lang="EN-GB"&gt;&amp;amp;')'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. At last we want to get the average-age of all customers, who bought in the selected time period, separeted by gender:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;men: Ø Age = (49,67+32)/2 = 40,83 years&lt;/P&gt;&lt;P&gt;women: Ø Age = (43,33)/1 = 43,33 years&lt;BR /&gt;&lt;SPAN lang="EN-GB"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Do you have an idea, how to get the last step?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot,&lt;BR /&gt;Katalina and Nina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2017 14:06:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/avg-Age/m-p/1446054#M610167</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-07T14:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: avg Age</title>
      <link>https://community.qlik.com/t5/QlikView/avg-Age/m-p/1446055#M610168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What happens when you wrap your expression around with Avg?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Avg(Aggr(Avg(Age), Customer, Order, $(=vSelectedDim)))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't understand the usage of &lt;SPAN lang="EN-GB" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;'&amp;amp;&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;$(vSelectedDim)&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;amp;')' in your expression. Since I don't know what that is doing, I am proposing to add something else... but this may not be perfect based on your field names with spaces and multiple selections etc&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2017 17:34:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/avg-Age/m-p/1446055#M610168</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-12-07T17:34:52Z</dc:date>
    </item>
  </channel>
</rss>

