<?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: how to calculate the average in bar chart in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/how-to-calculate-the-average-in-bar-chart/m-p/1518114#M37043</link>
    <description>Can you post a small QS app that I can use to show you what to change?</description>
    <pubDate>Fri, 07 Dec 2018 17:00:49 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2018-12-07T17:00:49Z</dc:date>
    <item>
      <title>how to calculate the average in bar chart</title>
      <link>https://community.qlik.com/t5/App-Development/how-to-calculate-the-average-in-bar-chart/m-p/1517878#M37028</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;I have the block point related to the implementation of Average Line in Qlik Sense Bar Chart.&lt;/P&gt;&lt;P&gt;Here are the details.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dimension: Weekend- Date (It is Drill down dimension)&lt;/P&gt;&lt;P&gt;Weekend is 1st level&lt;/P&gt;&lt;P&gt;Date is second level .&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: For my client, the weekend is Tuesday. So i used Weekend (date, 0,2) to calculate the Weekend of every date&lt;/P&gt;&lt;P&gt;Measure: Sum(TimeWorked)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Requirement:&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. I have to show the last 4 weeks data in the bar chart. So, bar chart shows 4 bars (4 Weekends) by default.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; This time, average should be&amp;nbsp; Sum(time worked)/4 because it is 4 bars&lt;/P&gt;&lt;P&gt;2. If user select any Weekend, then the bar chart should go to next level and shows 7 days in a week. This time, average is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Sum(time Worked)/7&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Issue:&amp;nbsp;&lt;/P&gt;&lt;P&gt;This two scenarios are working fine. but, when user select two Weekends, or two dates from different weeks the average is not showing correct. Please let me know if anyone implemented this scenario.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here the filters for date is Year, Monthyear( Aug-2018), Weekend, Date&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;apart from these 4 filters, there are someother filters. But the issue is , if user select filters not related to date then the expression changing its values as per the applicable dates. User is not sure about what dates it select by selecting the filter. Also, Average should calculate&amp;nbsp; as per the number of weekend bars displayed in chart&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=If(GetSelectedCount(PayWeekEnd)=0 and GetSelectedCount(PayrollRecordDate)=0 and GetSelectedCount(MonthYear)=0 and GetSelectedCount(Year)=0&lt;/P&gt;&lt;P&gt;,sum({&amp;lt;PayrollRecordDate={"&amp;gt;=$(=Date(WeekStart(max(PayWeekEnd)-21,0,2),'MM/DD/YYYY')) &amp;lt;=$(=Date(max(PayWeekEnd),'MM/DD/YYYY'))"}&amp;gt;}TimeWorked)/4,&lt;/P&gt;&lt;P&gt;if(GetSelectedCount(PayWeekEnd)&amp;gt;0 and GetSelectedCount(PayrollRecordDate)=0,&lt;BR /&gt;Sum({&amp;lt;PayrollRecordDate={"&amp;gt;=$(=Date(WeekStart(Max(PayWeekEnd),0,2),'MM/DD/YYYY')) &amp;lt;=$(=Date(max(PayWeekEnd),'MM/DD/YYYY'))"}&amp;gt;}TimeWorked)/7,&lt;BR /&gt;Avg(Aggr(Sum(TimeWorked),PayrollRecordDate))&lt;BR /&gt;))&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 07:06:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/how-to-calculate-the-average-in-bar-chart/m-p/1517878#M37028</guid>
      <dc:creator>konidena</dc:creator>
      <dc:date>2024-11-16T07:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate the average in bar chart</title>
      <link>https://community.qlik.com/t5/App-Development/how-to-calculate-the-average-in-bar-chart/m-p/1517991#M37034</link>
      <description>Perhaps you can multiply the 4 and 7 by the distinct number of weeks in the selection.</description>
      <pubDate>Fri, 07 Dec 2018 13:43:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/how-to-calculate-the-average-in-bar-chart/m-p/1517991#M37034</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2018-12-07T13:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate the average in bar chart</title>
      <link>https://community.qlik.com/t5/App-Development/how-to-calculate-the-average-in-bar-chart/m-p/1518000#M37035</link>
      <description>&lt;P&gt;I didn't understand clearly. Could you please explain more.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 13:53:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/how-to-calculate-the-average-in-bar-chart/m-p/1518000#M37035</guid>
      <dc:creator>konidena</dc:creator>
      <dc:date>2018-12-07T13:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate the average in bar chart</title>
      <link>https://community.qlik.com/t5/App-Development/how-to-calculate-the-average-in-bar-chart/m-p/1518114#M37043</link>
      <description>Can you post a small QS app that I can use to show you what to change?</description>
      <pubDate>Fri, 07 Dec 2018 17:00:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/how-to-calculate-the-average-in-bar-chart/m-p/1518114#M37043</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2018-12-07T17:00:49Z</dc:date>
    </item>
  </channel>
</rss>

