<?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: AGGR in Script (requires minimum?) / Count only one across 3 fields in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/AGGR-in-Script-requires-minimum/m-p/1746016#M721393</link>
    <description>&lt;P&gt;I want to count outcome once based on the earliest date.&lt;/P&gt;&lt;P&gt;I can do the modify the aggr that I posted earlier&amp;nbsp;with&amp;nbsp; the new field "Outcome" but was thinking is there another way to do within the expression and not create any new fields.&lt;/P&gt;</description>
    <pubDate>Tue, 22 Sep 2020 13:11:01 GMT</pubDate>
    <dc:creator>NewbieToQV</dc:creator>
    <dc:date>2020-09-22T13:11:01Z</dc:date>
    <item>
      <title>AGGR in Script (requires minimum?)</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-in-Script-requires-minimum/m-p/1745993#M721388</link>
      <description>&lt;P&gt;Hi, I need to load the below into QV loading script but unable to convert into a script. I tried a few variations of Min/FirstSortedValue but did not work. Please help.&lt;/P&gt;&lt;P&gt;Aggr(NODISTINCT If([Type (Rank)] = Min(TOTAL &amp;lt;[Group Name]&amp;gt; [Type (Rank)]), [Group Name]), [Group Name], [Type (Rank)])&lt;/P&gt;&lt;P&gt;What I need is for the same group name, I only want to show the Group Name with the smaller Type (Rank)&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;TABLE border="1" width="56.19403212817747%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="25%" height="24px"&gt;Group Name&lt;/TD&gt;&lt;TD width="25%" height="24px"&gt;Type (Rank)&lt;/TD&gt;&lt;TD width="12.5%" height="24px"&gt;Date&lt;/TD&gt;&lt;TD width="6.25%" height="24px"&gt;Outcome (from script)&lt;/TD&gt;&lt;TD width="6.25%"&gt;Outcome for Count&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="24px"&gt;A&lt;/TD&gt;&lt;TD width="25%" height="24px"&gt;1&lt;/TD&gt;&lt;TD width="12.5%" height="24px"&gt;1 Feb 2020&lt;/TD&gt;&lt;TD width="6.25%" height="24px"&gt;A&lt;/TD&gt;&lt;TD width="6.25%"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="24px"&gt;A&lt;/TD&gt;&lt;TD width="25%" height="24px"&gt;2&lt;/TD&gt;&lt;TD width="12.5%" height="24px"&gt;1 Jan 2020&lt;/TD&gt;&lt;TD width="6.25%" height="24px"&gt;blank&lt;/TD&gt;&lt;TD width="6.25%"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="24px"&gt;A&lt;/TD&gt;&lt;TD width="25%" height="24px"&gt;2&lt;/TD&gt;&lt;TD width="12.5%" height="24px"&gt;1 Jan 2020&lt;/TD&gt;&lt;TD width="6.25%" height="24px"&gt;blank&lt;/TD&gt;&lt;TD width="6.25%"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="24px"&gt;B&lt;/TD&gt;&lt;TD width="25%" height="24px"&gt;3&lt;/TD&gt;&lt;TD width="12.5%" height="24px"&gt;1 Apr 2020&lt;/TD&gt;&lt;TD width="6.25%" height="24px"&gt;B&lt;/TD&gt;&lt;TD width="6.25%"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="24px"&gt;B&lt;/TD&gt;&lt;TD width="25%" height="24px"&gt;3&lt;/TD&gt;&lt;TD width="12.5%" height="24px"&gt;1 Mar 2020&lt;/TD&gt;&lt;TD width="6.25%" height="24px"&gt;B&lt;/TD&gt;&lt;TD width="6.25%"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reason for creating the script is to act as a step to produce the final outcome of count. I was unable to nest 2 aggr in my table.&lt;/P&gt;&lt;P&gt;Thks!&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-in-Script-requires-minimum/m-p/1745993#M721388</guid>
      <dc:creator>NewbieToQV</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: AGGR in Script (requires minimum?) / Count only one across 3 fields</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-in-Script-requires-minimum/m-p/1746004#M721389</link>
      <description>&lt;P&gt;Do you need the count from the script also?, if not, try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Table:
LOAD *,
	 RowNo() as RowNum;
LOAD * INLINE [
    Group Name, Type (Rank), Date
    A, 1, 1 Feb 2020
    A, 2, 1 Jan 2020
    A, 2, 1 Jan 2020
    B, 3, 1 Apr 2020
    B, 3, 1 Mar 2020
];

Left Join (Table)
LOAD [Group Name],
	 Min([Type (Rank)]) as [Type (Rank)],
	 [Group Name] as [Outcome]
Resident Table
Group By [Group Name];&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 22 Sep 2020 12:40:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-in-Script-requires-minimum/m-p/1746004#M721389</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2020-09-22T12:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: AGGR in Script (requires minimum?) / Count only one across 3 fields</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-in-Script-requires-minimum/m-p/1746007#M721390</link>
      <description>&lt;P&gt;And may be this for the Outcome for count field&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Table:
LOAD RowNo() as RowNum,
	 [Group Name],
	 [Type (Rank)],
	 Date#(Date, 'D MMM YYYY') as Date;
LOAD * INLINE [
    Group Name, Type (Rank), Date
    A, 1, 1 Feb 2020
    A, 2, 1 Jan 2020
    A, 2, 1 Jan 2020
    B, 3, 1 Apr 2020
    B, 3, 1 Mar 2020
];

Left Join (Table)
LOAD [Group Name],
	 Min([Type (Rank)]) as [Type (Rank)],
	 [Group Name] as [Outcome]
Resident Table
Group By [Group Name];

Left Join (Table)
LOAD [Group Name],
	 [Outcome],
	 Min(Date) as Date,
	 1 as [Outcome for Count]
Resident Table
Where Len(Trim(Outcome)) &amp;gt; 0
Group By [Group Name], [Outcome];&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 22 Sep 2020 12:43:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-in-Script-requires-minimum/m-p/1746007#M721390</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2020-09-22T12:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: AGGR in Script (requires minimum?) / Count only one across 3 fields</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-in-Script-requires-minimum/m-p/1746009#M721391</link>
      <description>&lt;P&gt;Works like magic. Thanks. I will use that as a workaround for now.&lt;/P&gt;&lt;P&gt;Would you happen to be able to solve the count as well? (Without the&amp;nbsp; script but as a function (2 aggr?) in the tables)&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2020 12:54:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-in-Script-requires-minimum/m-p/1746009#M721391</guid>
      <dc:creator>NewbieToQV</dc:creator>
      <dc:date>2020-09-22T12:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: AGGR in Script (requires minimum?) / Count only one across 3 fields</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-in-Script-requires-minimum/m-p/1746014#M721392</link>
      <description>&lt;P&gt;So, you want to Count Outcome field only once? May be use Count(DISTINCT Outcome)?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2020 13:04:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-in-Script-requires-minimum/m-p/1746014#M721392</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2020-09-22T13:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: AGGR in Script (requires minimum?) / Count only one across 3 fields</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-in-Script-requires-minimum/m-p/1746016#M721393</link>
      <description>&lt;P&gt;I want to count outcome once based on the earliest date.&lt;/P&gt;&lt;P&gt;I can do the modify the aggr that I posted earlier&amp;nbsp;with&amp;nbsp; the new field "Outcome" but was thinking is there another way to do within the expression and not create any new fields.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2020 13:11:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-in-Script-requires-minimum/m-p/1746016#M721393</guid>
      <dc:creator>NewbieToQV</dc:creator>
      <dc:date>2020-09-22T13:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: AGGR in Script (requires minimum?) / Count only one across 3 fields</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-in-Script-requires-minimum/m-p/1746040#M721394</link>
      <description>&lt;P&gt;May be this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sum(Aggr(If(Min(TOTAL &amp;lt;[Group Name], Outcome&amp;gt; {&amp;lt;Outcome *= {"*"}&amp;gt;} Date) = Date, 1, 0), [Group Name], [Type (Rank)], Date, Outcome))&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 22 Sep 2020 13:49:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-in-Script-requires-minimum/m-p/1746040#M721394</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2020-09-22T13:49:22Z</dc:date>
    </item>
  </channel>
</rss>

