<?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: Using the average function of a sum in frontend in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137578#M9657</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Marcus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your suggestion but it didn't help, unfortunately. &lt;/P&gt;&lt;P&gt;I used the code in for the expression in frontend:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="2018-08-15_17-15-27.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/210933_2018-08-15_17-15-27.jpg" style="height: 277px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt; But I do not get any average value when I run my report.&lt;/P&gt;&lt;P&gt;Any other suggestion or can I modify the sqript somehow?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Aug 2018 15:25:10 GMT</pubDate>
    <dc:creator>magnusrydberg</dc:creator>
    <dc:date>2018-08-15T15:25:10Z</dc:date>
    <item>
      <title>Using the average function of a sum in frontend</title>
      <link>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137576#M9655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to use the average function in the frontend to calculate the average value for a sum of two fields.&lt;/P&gt;&lt;P&gt;My expression in frontend looks like this: Avg(UUniqueUserPortal+UUniqueUserApp).&lt;/P&gt;&lt;P&gt;I've got no values by this expression....&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;IMG alt="2018-08-14_17-09-12.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/210813_2018-08-14_17-09-12.jpg" style="height: 301px; width: 620px;" /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;What am I doing wrong in my expression? &lt;/STRONG&gt;&lt;/EM&gt;(When using only one variable at a time I've gott an average value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The two fields&lt;STRONG&gt; UUniqueUse&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;rPortal&lt;/STRONG&gt; and &lt;STRONG&gt;UUniqueUserApp&lt;/STRONG&gt; come from two different files. My sqript look like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt;LOAD &lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LoginDate as ULoginDate,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year(LoginDate) as UYear,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Week(LoginDate) as UWeek,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dual( Year(LoginDate) &amp;amp; '-' &amp;amp; Week(LoginDate), num(Year(LoginDate)) &amp;amp; num(Week(LoginDate), '00' )) as UYearWeek,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(1=1,'Portal') as UType,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dual( Year(LoginDate) &amp;amp; '-' &amp;amp; Month(LoginDate), num(Year(LoginDate)) &amp;amp; num(Month(LoginDate), '00' )) as UYearMonth,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333px;"&gt;&amp;nbsp; If(num(weekday(LoginDate))&amp;lt;&amp;gt;6 and num(weekday(LoginDate))&amp;lt;&amp;gt;7,Count("UserId")) as UUniqueUserPortal&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333px;"&gt;&amp;nbsp; Group By LoginDate;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333px;"&gt;SQL SELECT *FROM "myloc_PROD_220".cacore.EnvUsersLog;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333px;"&gt;LOAD &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LoginDate as Ulogindate,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year(LoginDate) as UYear,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Week(LoginDate) as UWeek,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dual( Year(LoginDate) &amp;amp; '-' &amp;amp; Week(LoginDate), num(Year(LoginDate)) &amp;amp; num(Week(LoginDate), '00' )) as UYearWeek,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dual( Year(LoginDate) &amp;amp; '-' &amp;amp; Month(LoginDate), num(Year(LoginDate)) &amp;amp; num(Month(LoginDate), '00' )) as [UYearMonth],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(1=1,'App') as UType,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SystemType as USystemTyp,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(num(weekday(LoginDate))&amp;lt;&amp;gt;6 and num(weekday(LoginDate))&amp;lt;&amp;gt;7,Count("UserID")) as UUniqueUserApp&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Group By LoginDate,SystemType;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt;&amp;nbsp; SQL Select *FROM "myloc_PROD_220".OTSDATA.UserLoginLog;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2018 15:23:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137576#M9655</guid>
      <dc:creator>magnusrydberg</dc:creator>
      <dc:date>2018-08-14T15:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using the average function of a sum in frontend</title>
      <link>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137577#M9656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you need an aggr() for it, maybe:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;avg(aggr(sum(&lt;STRONG&gt;UUniqueUse&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;rPortal)&lt;/STRONG&gt; + sum(&lt;STRONG&gt;UUniqueUserApp&lt;/STRONG&gt;&lt;/SPAN&gt;), Dim1, Dim2))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;whereby Dim1 and Dim2 are placeholder for the dimensions in whose context the calculation should be done (usually this are the used dimensions within the chart).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2018 12:51:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137577#M9656</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-08-15T12:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: Using the average function of a sum in frontend</title>
      <link>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137578#M9657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Marcus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your suggestion but it didn't help, unfortunately. &lt;/P&gt;&lt;P&gt;I used the code in for the expression in frontend:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="2018-08-15_17-15-27.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/210933_2018-08-15_17-15-27.jpg" style="height: 277px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt; But I do not get any average value when I run my report.&lt;/P&gt;&lt;P&gt;Any other suggestion or can I modify the sqript somehow?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2018 15:25:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137578#M9657</guid>
      <dc:creator>magnusrydberg</dc:creator>
      <dc:date>2018-08-15T15:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using the average function of a sum in frontend</title>
      <link>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137579#M9658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this:&lt;/P&gt;&lt;P&gt;Avg(Aggr(Sum(UUniqueUserPortal) + Sum(UUniqueUserApp), UUniqueUserPortal, UUniqueUserApp))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RangeAvg(UUniqueUserPortal,UUniqueUserApp)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2018 15:28:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137579#M9658</guid>
      <dc:creator>BalaBhaskar_Qlik</dc:creator>
      <dc:date>2018-08-15T15:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using the average function of a sum in frontend</title>
      <link>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137580#M9659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;for this to work correctly you would need to make sure that both &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;UUniqueUserPortal and UUniqueUserApp have values on a single line, like this:&lt;/SPAN&gt;&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;UYearWeek&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;UUniqueUserPortal&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;UUniqueUserApp&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2018-22&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2018-23&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2018-24&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;I suppose this is not true in your case and you have something like this&lt;/SPAN&gt;&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;UYearWeek&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG style="color: #ffffff; font-size: 13.3333px; text-align: center;"&gt;UUniqueUserPortal&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG style="color: #ffffff; font-size: 13.3333px; text-align: center;"&gt;UUniqueUserApp&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2018-22&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;NULL&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2018-22&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;NULL&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2018-23&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;NULL&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2018-23&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;NULL&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;In Qlik Null+1=Null, therefore in your expression Avg(Null+1)=Avg(Null)=Null. You could either adjust your data model by using Join or try using&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;RangeAvg(Sum(UUniqueUserPortal), Sum(UUniqueUserApp))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;or&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Avg(Aggr(Sum(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;UUniqueUserPortal), Sum(UUniqueUserApp), UYearWeek))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;depending on what you need to achieve.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Hope this helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Juraj&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2018 16:29:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137580#M9659</guid>
      <dc:creator>juraj_misina</dc:creator>
      <dc:date>2018-08-15T16:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using the average function of a sum in frontend</title>
      <link>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137581#M9660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to replace the Dim1,Dim2 placeholder with the real fields in which context the calculation should be done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 06:03:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137581#M9660</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-08-16T06:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using the average function of a sum in frontend</title>
      <link>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137582#M9661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Juraj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help! But I do not really succeed unfortunately...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried to adjust my data by using join and also used the &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #f2f2f2;"&gt;&lt;STRONG&gt;&lt;EM&gt;Avg(Aggr(Sum(&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;&lt;STRONG&gt;&lt;EM&gt;UUniqueUserPortal), Sum(UUniqueUserApp), ULoginDate))&lt;/EM&gt;&lt;/STRONG&gt; but I got no results..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;When I Use the command &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #f2f2f2;"&gt;&lt;STRONG&gt;&lt;EM&gt;RangeAvg(Sum(UUniqueUserPortal), Sum(UUniqueUserApp))&lt;/EM&gt;&lt;/STRONG&gt; in my expression I've got some figures but that not seems to be the average value I want to see.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #f2f2f2;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #f2f2f2;"&gt;I really want to present the average value of number of unique persons per day that logged in to the system. In my case this information is separated in 2 files in the system, cacore.EnvUsersLog for portal users and OTSDATA.UserLoginLog for app users. &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #f2f2f2;"&gt;In my sqript I've done a calculation of nuber of users per day using command Group by&amp;nbsp; LoginDate.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #f2f2f2;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #f2f2f2;"&gt;My sqript look like this now:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;// User Statistics&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LoginDate as ULoginDate,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year(LoginDate) as UYear,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Week(LoginDate) as UWeek,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dual( Year(LoginDate) &amp;amp; '-' &amp;amp; Week(LoginDate), num(Year(LoginDate)) &amp;amp; num(Week(LoginDate), '00' )) as UYearWeek,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(1=1,'Portal') as UType,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dual( Year(LoginDate) &amp;amp; '-' &amp;amp; Month(LoginDate), num(Year(LoginDate)) &amp;amp; num(Month(LoginDate), '00' )) as UYearMonth,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp; If(num(weekday(LoginDate))&amp;lt;&amp;gt;6 and num(weekday(LoginDate))&amp;lt;&amp;gt;7,Count(DISTINCT "UserId")) as UUniqueUserPortal&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp; Group By LoginDate;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;SQL SELECT *FROM "myloc_PROD_220".cacore.EnvUsersLog;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Join&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;LOAD&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LoginDate as ULoginDate,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year(LoginDate) as UYear,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Week(LoginDate) as UWeek,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dual( Year(LoginDate) &amp;amp; '-' &amp;amp; Week(LoginDate), num(Year(LoginDate)) &amp;amp; num(Week(LoginDate), '00' )) as UYearWeek,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dual( Year(LoginDate) &amp;amp; '-' &amp;amp; Month(LoginDate), num(Year(LoginDate)) &amp;amp; num(Month(LoginDate), '00' )) as [UYearMonth],&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(1=1,'App') as UType,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SystemType as USystemTyp,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(num(weekday(LoginDate))&amp;lt;&amp;gt;6 and num(weekday(LoginDate))&amp;lt;&amp;gt;7,Count(DISTINCT "UserID")) as UUniqueUserApp&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Group By LoginDate,SystemType;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; SQL Select *FROM "myloc_PROD_220".OTSDATA.UserLoginLog;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;So the problem is what expression should I use in front end to present the mean value of number of users per day during a month. (I also have another graph presenting the maxvalue of users per day during a month). Graphs look like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;IMG alt="2018-08-16_13-46-53.jpg" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/211046_2018-08-16_13-46-53.jpg" style="height: 403px; width: 620px;" /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;The expression I've tried that gives any result is: &lt;EM&gt;RangeAvg(Sum(UUniqueUserPortal), Sum(UUniqueUserApp)) &lt;/EM&gt;but this is not the correct mean value(see above). Using the &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #f2f2f2;"&gt;&lt;STRONG&gt;&lt;EM&gt;Avg(Aggr(Sum(&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;&lt;EM&gt;UUniqueUserPortal), Sum(UUniqueUserApp), ULoginDate)) &lt;/EM&gt;returns no values at all...&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; background-color: #f2f2f2; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;So please do you have any other suggestion what expression I should use?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; background-color: #f2f2f2; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;IMG alt="2018-08-16_13-54-58.jpg" class="jive-image image-2" height="252" src="https://community.qlik.com/legacyfs/online/211030_2018-08-16_13-54-58.jpg" style="width: 680px; height: 252.279px;" width="680" /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;// Magnus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 12:12:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137582#M9661</guid>
      <dc:creator>magnusrydberg</dc:creator>
      <dc:date>2018-08-16T12:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using the average function of a sum in frontend</title>
      <link>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137583#M9662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Magnus,&lt;/P&gt;&lt;P&gt;sorry, my bad, I had a typo in one of expressions:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #f2f2f2;"&gt;Avg(Aggr(Sum(&lt;/SPAN&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;UUniqueUserPortal)&lt;STRONG&gt;+&lt;/STRONG&gt;Sum(UUniqueUserApp), UYearMonth))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This should work.&lt;/P&gt;&lt;P&gt;Juraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 12:28:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137583#M9662</guid>
      <dc:creator>juraj_misina</dc:creator>
      <dc:date>2018-08-16T12:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using the average function of a sum in frontend</title>
      <link>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137584#M9663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your join will act like a concatenate due to different values in he UType field. So the values never align. I do believe that Marcus' design pattern is correct,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;avg(aggr(sum(UUniqueUserPortal) + sum(UUniqueUserApp), Dim1, Dim2))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it is important to have the correct dimensions for the aggr(). What is correct is dependent on the data model and the charts. At a minimum, the dimensions should include the chart's dimension(s).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 12:44:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137584#M9663</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2018-08-16T12:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Using the average function of a sum in frontend</title>
      <link>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137585#M9664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I get a value &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; but it seems not to be an average value per day...... It seems more like a sum for the actual month. The value for august should be about 150-160 unique users but the graph shows 1629.....&lt;/P&gt;&lt;P&gt;&lt;IMG alt="2018-08-16_14-39-31.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/211048_2018-08-16_14-39-31.jpg" style="height: 290px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;Any more ideas? &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;// Magnus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 12:44:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137585#M9664</guid>
      <dc:creator>magnusrydberg</dc:creator>
      <dc:date>2018-08-16T12:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using the average function of a sum in frontend</title>
      <link>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137586#M9665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are so right!&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;I've changed the expression to:&lt;/P&gt;&lt;P&gt;Avg(Aggr(Sum(UUniqueUserPortal)+Sum(UUniqueUserApp),ULoginDate, UYearMonth)) and now it seems to work!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I Suppose Marcus and Jurij meant so also but I misunderstood..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank a lot to all of you!&lt;/P&gt;&lt;P&gt;// Magnus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 12:53:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137586#M9665</guid>
      <dc:creator>magnusrydberg</dc:creator>
      <dc:date>2018-08-16T12:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using the average function of a sum in frontend</title>
      <link>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137587#M9666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot Jurij!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now it works with the expression: Avg(Aggr(Sum(UUniqueUserPortal)+Sum(UUniqueUserApp),ULoginDate, UYearMonth))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've learnt a lot &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;// Magnus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 12:56:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137587#M9666</guid>
      <dc:creator>magnusrydberg</dc:creator>
      <dc:date>2018-08-16T12:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using the average function of a sum in frontend</title>
      <link>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137588#M9667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm glad it worked. Take care.&lt;/P&gt;&lt;P&gt;Juraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 13:16:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/137588#M9667</guid>
      <dc:creator>juraj_misina</dc:creator>
      <dc:date>2018-08-16T13:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using the average function of a sum in frontend</title>
      <link>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/1804280#M65337</link>
      <description>&lt;P&gt;How would you exclude 0 (zero) values in this function?&lt;BR /&gt;(I have a similar expression)&lt;/P&gt;</description>
      <pubDate>Fri, 30 Apr 2021 17:56:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-the-average-function-of-a-sum-in-frontend/m-p/1804280#M65337</guid>
      <dc:creator>Qstradamus</dc:creator>
      <dc:date>2021-04-30T17:56:30Z</dc:date>
    </item>
  </channel>
</rss>

