<?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 Nested aggr of distinct fields in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Nested-aggr-of-distinct-fields/m-p/1573373#M598050</link>
    <description>&lt;P&gt;I have data of the following structure;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Date&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;User ID&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Product Group&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Product&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Value&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1/4/19&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;A&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Ducks&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;#1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1/4/19&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;B&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Ducks&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;#1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;2/4/19&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;A&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Ducks&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;#1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;2/4/19&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;A&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Ducks&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;#2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;2/4/19&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;A&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Swans&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;#3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;2/4/19&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;B&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Swans&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;#4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Aim is to produce the sum value for each specific date however the sum must include the highest value for each product group that each User ID has used on that date&lt;/P&gt;&lt;P&gt;I.e&lt;/P&gt;&lt;P&gt;01/04/19 = 2 (1+1)&lt;/P&gt;&lt;P&gt;02/04/19 =5 (2+2+1)&lt;/P&gt;&lt;P&gt;Real data is patient sensitive hence the ducks &amp;amp; swans!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been try without much success sum, aggr &amp;amp; distinct various combinations of the fields without success.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help appreciated as I'm a department of 1 inexperienced operator.&lt;/P&gt;</description>
    <pubDate>Thu, 25 Apr 2019 14:06:03 GMT</pubDate>
    <dc:creator>robertsn</dc:creator>
    <dc:date>2019-04-25T14:06:03Z</dc:date>
    <item>
      <title>Nested aggr of distinct fields</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-aggr-of-distinct-fields/m-p/1573373#M598050</link>
      <description>&lt;P&gt;I have data of the following structure;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Date&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;User ID&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Product Group&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Product&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Value&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1/4/19&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;A&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Ducks&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;#1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1/4/19&lt;/P&gt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/TD&gt;&lt;TD&gt;&lt;P&gt;#4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Aim is to produce the sum value for each specific date however the sum must include the highest value for each product group that each User ID has used on that date&lt;/P&gt;&lt;P&gt;I.e&lt;/P&gt;&lt;P&gt;01/04/19 = 2 (1+1)&lt;/P&gt;&lt;P&gt;02/04/19 =5 (2+2+1)&lt;/P&gt;&lt;P&gt;Real data is patient sensitive hence the ducks &amp;amp; swans!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been try without much success sum, aggr &amp;amp; distinct various combinations of the fields without success.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help appreciated as I'm a department of 1 inexperienced operator.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 14:06:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-aggr-of-distinct-fields/m-p/1573373#M598050</guid>
      <dc:creator>robertsn</dc:creator>
      <dc:date>2019-04-25T14:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Nested aggr of distinct fields</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-aggr-of-distinct-fields/m-p/1573376#M598051</link>
      <description>&lt;P&gt;May be this&lt;/P&gt;&lt;PRE&gt;Sum(Aggr(Max(Aggr(Sum(Value), Date, [User ID], [Product Group])), Date, [User ID]))&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Apr 2019 14:09:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-aggr-of-distinct-fields/m-p/1573376#M598051</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-04-25T14:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: Nested aggr of distinct fields</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-aggr-of-distinct-fields/m-p/1573378#M598052</link>
      <description>&lt;P&gt;Actually, how are you getting 2+2+1 for 2/4? Can you explain which rows are you picking and why?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 14:12:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-aggr-of-distinct-fields/m-p/1573378#M598052</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-04-25T14:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: Nested aggr of distinct fields</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-aggr-of-distinct-fields/m-p/1573604#M598055</link>
      <description>&lt;P&gt;From&amp;nbsp; 2/4/19,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A Ducks #2 = 2 (largest value)&lt;/P&gt;&lt;P&gt;A Swans #3 = 2&lt;/P&gt;&lt;P&gt;B Swans #4 = 1&lt;/P&gt;&lt;P&gt;Total 5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the real data;&lt;/P&gt;&lt;P&gt;on a given date....&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;there will be many patients&lt;UL&gt;&lt;LI&gt;each patient might have multiple different drugs prepared for them&lt;UL&gt;&lt;LI&gt;each drug can have multiple presentations&lt;UL&gt;&lt;LI&gt;some of the presentations might take more work to prepare&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;We grabbing a workload snap shot from a different data set which is primarily financial rather that capacity/workload planning. We have a capacity model that assigns a complexity rating (crudely a time measure) to the preparation of differing drugs and their pharmaceutical presentation.&lt;/P&gt;&lt;P&gt;Using the financial data gives us faster access to workload data, all be it only an approximation, and allows better matching resource to patient load than we can achieve waiting for manufacturing and clinic data feedback.&lt;/P&gt;&lt;P&gt;Ideally I need to....&lt;/P&gt;&lt;P&gt;Total daily workload ('value')&lt;/P&gt;&lt;P&gt;Total by active drug ('Ducks &amp;amp; Swans') - however I need to grab only the hardest preparation (highest 'value') as my capacity (complexity) measure otherwise I will end up with grossly inflation estimated workload which will be valueless in maintaining maximised throughput&lt;/P&gt;&lt;P&gt;Total by patient ('A &amp;amp; B')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for the long winded explanation!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2019 06:57:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-aggr-of-distinct-fields/m-p/1573604#M598055</guid>
      <dc:creator>robertsn</dc:creator>
      <dc:date>2019-04-26T06:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: Nested aggr of distinct fields</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-aggr-of-distinct-fields/m-p/1573773#M598057</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;Sum(Aggr(Max(Value), Date, [User ID], [Product Group]))&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2019 11:19:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-aggr-of-distinct-fields/m-p/1573773#M598057</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-04-26T11:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: Nested aggr of distinct fields</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-aggr-of-distinct-fields/m-p/1573797#M598059</link>
      <description>&lt;P&gt;Thanks, that's much closer to where I think the value should be (from looking at the data manually).&lt;/P&gt;&lt;P&gt;Appreciate you taking the time&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2019 11:40:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-aggr-of-distinct-fields/m-p/1573797#M598059</guid>
      <dc:creator>robertsn</dc:creator>
      <dc:date>2019-04-26T11:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: Nested aggr of distinct fields</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-aggr-of-distinct-fields/m-p/1573800#M598062</link>
      <description>&lt;P&gt;That's great. I am glad I was able to help&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2019 11:41:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-aggr-of-distinct-fields/m-p/1573800#M598062</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-04-26T11:41:35Z</dc:date>
    </item>
  </channel>
</rss>

