<?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: Nested aggregation not allowed in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Nested-aggregation-not-allowed/m-p/2087631#M1224105</link>
    <description>&lt;P&gt;You might want to use Sum instead of count, as it will currently count all occurrences regardless of being 1,0.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;About the nested aggregation itself, you might want to look at set identifiers expressions in order to filter through and avoid this error, this will allow you select only the values you desire to then count them without using the if():&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/May2023/Subsystems/Client/Content/QV_QlikView/ChartFunctions/SetAnalysis/set-analysis-expressions.htm" target="_blank"&gt; https://help.qlik.com/en-US/qlikview/May2023/Subsystems/Client/Content/QV_QlikView/ChartFunctions/SetAnalysis/set-analysis-expressions.htm&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Jun 2023 07:58:24 GMT</pubDate>
    <dc:creator>QGTFS</dc:creator>
    <dc:date>2023-06-26T07:58:24Z</dc:date>
    <item>
      <title>Nested aggregation not allowed</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-aggregation-not-allowed/m-p/2087424#M1224103</link>
      <description>&lt;P&gt;Hi, i use this code to determine which item finished in valid duration:&lt;BR /&gt;=if(if(Only(itemNo) and Only(finishDate), finishDate-startDate, Today()-startDate)&amp;lt;=validRequestDuration,1,0)&lt;/P&gt;
&lt;P&gt;now i want to use this code to know how many item finished in valid duration:&lt;BR /&gt;=Count(if(if(Only(itemNo) and Only(finishDate), finishDate-startDate, Today()-startDate)&amp;lt;=validRequestDuration,1,0))&lt;/P&gt;
&lt;P&gt;but its not work and show diffrent errors...&lt;/P&gt;
&lt;P&gt;How can i get count of items that finish in valid duration?&lt;/P&gt;
&lt;P&gt;Thanks in advanced&lt;/P&gt;</description>
      <pubDate>Sat, 24 Jun 2023 15:11:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-aggregation-not-allowed/m-p/2087424#M1224103</guid>
      <dc:creator>arash64a</dc:creator>
      <dc:date>2023-06-24T15:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: Nested aggregation not allowed</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-aggregation-not-allowed/m-p/2087631#M1224105</link>
      <description>&lt;P&gt;You might want to use Sum instead of count, as it will currently count all occurrences regardless of being 1,0.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;About the nested aggregation itself, you might want to look at set identifiers expressions in order to filter through and avoid this error, this will allow you select only the values you desire to then count them without using the if():&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/May2023/Subsystems/Client/Content/QV_QlikView/ChartFunctions/SetAnalysis/set-analysis-expressions.htm" target="_blank"&gt; https://help.qlik.com/en-US/qlikview/May2023/Subsystems/Client/Content/QV_QlikView/ChartFunctions/SetAnalysis/set-analysis-expressions.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 07:58:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-aggregation-not-allowed/m-p/2087631#M1224105</guid>
      <dc:creator>QGTFS</dc:creator>
      <dc:date>2023-06-26T07:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: Nested aggregation not allowed</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-aggregation-not-allowed/m-p/2087920#M1224110</link>
      <description>&lt;P&gt;Yes, its true.&lt;/P&gt;
&lt;P&gt;can you write my script correctly with Sum please?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 15:50:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-aggregation-not-allowed/m-p/2087920#M1224110</guid>
      <dc:creator>arash64a</dc:creator>
      <dc:date>2023-06-26T15:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: Nested aggregation not allowed</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-aggregation-not-allowed/m-p/2087944#M1224111</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/235857"&gt;@arash64a&lt;/a&gt;&amp;nbsp; Maybe something along these lines.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;In script&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;Tmp:&lt;BR /&gt;LOAD itemNo,&lt;BR /&gt;startDate,&lt;BR /&gt;finishDate,&lt;BR /&gt;validRequestDuration&lt;/P&gt;
&lt;P&gt;FROM xyz;&lt;/P&gt;
&lt;P&gt;Table:&lt;BR /&gt;LOAD *,&lt;BR /&gt;If(Flag = 0, finishDate-startDate,&lt;BR /&gt;If(Flag = 1, Today())-startDate) as DateDiff;&lt;/P&gt;
&lt;P&gt;LOAD itemNo,&lt;BR /&gt;Only(finishDate) as finishDate,&lt;BR /&gt;Only(finishDate) as startDate,&lt;BR /&gt;Only(validRequestDuration) as validRequestDuration,&lt;BR /&gt;If(Count(itemNo) &amp;gt; 1 and Count(finishDate) &amp;gt; 1, 1, 0) as Flag //1 for non distinct, 0 for distinct&lt;/P&gt;
&lt;P&gt;Resident Tmp&lt;BR /&gt;Group By itemNo;&lt;/P&gt;
&lt;P&gt;DROP Table Tmp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Expression&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;=Sum(If(DateDiff &amp;lt;= validRequestDuration, 1 , 0))&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 17:24:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-aggregation-not-allowed/m-p/2087944#M1224111</guid>
      <dc:creator>BrunPierre</dc:creator>
      <dc:date>2023-06-26T17:24:28Z</dc:date>
    </item>
  </channel>
</rss>

