<?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: Expression not producing expected results in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expression-not-producing-expected-results/m-p/1656128#M448284</link>
    <description>&lt;P&gt;That was quick, and it works!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Zak&lt;/P&gt;</description>
    <pubDate>Tue, 10 Dec 2019 15:51:51 GMT</pubDate>
    <dc:creator>zakpullen</dc:creator>
    <dc:date>2019-12-10T15:51:51Z</dc:date>
    <item>
      <title>Expression not producing expected results</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-not-producing-expected-results/m-p/1656112#M448278</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have data similar to the fake table below. The start and end dates are the period for which a doctor is assigned to a RotaID. For any given month (MonthYear) I want to aggregate wte * rotadays for each RotaID. Rotadays are the number of days a doctor is assigned to a RotaID in the given month. For example, rotadays for May 2020 in the first row would be 4.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RotaTbl.JPG" style="width: 550px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/25285i3A8E3A787F498724/image-size/large?v=v2&amp;amp;px=999" role="button" title="RotaTbl.JPG" alt="RotaTbl.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have a calculation that works fine if there is a single doctor against a RotaID in a specific month:&lt;/P&gt;&lt;P&gt;AGGR(Count(Distinct RotaDate)*sum(RotaWTE),RotaID,RotaMonthYear)&lt;/P&gt;&lt;P&gt;However it doesn't work if 2 doctors are against a RotaID in the same month. If we take RotaID Anaes SPR2 and August 2019 as an example.&lt;/P&gt;&lt;P&gt;The correct calculation should be:&lt;/P&gt;&lt;P&gt;Michael Wood: 31 * 0.7 = 21.7&lt;/P&gt;&lt;P&gt;Michelle Brown: 25 * 0.8 = 20&lt;/P&gt;&lt;P&gt;The expression should return 41.7 (21.7 + 20)&lt;/P&gt;&lt;P&gt;However, it is not performing each calculation seperately, and aggregating the results. It is first adding the wte together (0.7 + 0.8 = 1.5), and then multiplying that by the first&amp;nbsp;count of rotadays (31) to produce 46.5.&lt;/P&gt;&lt;P&gt;I've experimented with my expression, but just cannot nail it. I tried&amp;nbsp;including a RowID, but that didn't work.&lt;/P&gt;&lt;P&gt;Is there a solution? I don't think this can be done in the script as a calendar is created, and an interval table used to link it to the data table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 01:44:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-not-producing-expected-results/m-p/1656112#M448278</guid>
      <dc:creator>zakpullen</dc:creator>
      <dc:date>2024-11-16T01:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: Expression not producing expected results</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-not-producing-expected-results/m-p/1656116#M448280</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sum(Aggr(
    Count(DISTINCT RotaDate) * Sum(RotaWTE)
, RotaID, RotaMonthYear, [First Name], [Last Name]))&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 10 Dec 2019 15:29:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-not-producing-expected-results/m-p/1656116#M448280</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-12-10T15:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: Expression not producing expected results</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-not-producing-expected-results/m-p/1656128#M448284</link>
      <description>&lt;P&gt;That was quick, and it works!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Zak&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 15:51:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-not-producing-expected-results/m-p/1656128#M448284</guid>
      <dc:creator>zakpullen</dc:creator>
      <dc:date>2019-12-10T15:51:51Z</dc:date>
    </item>
  </channel>
</rss>

