<?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: not working in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/not-working-in-script/m-p/684996#M1065127</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Error : Nested aggregation not allowed &lt;/P&gt;&lt;P&gt;my script &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Final:&lt;/P&gt;&lt;P&gt;Load prod,max(if(q1&amp;lt;max(start),sum(If(start&amp;lt;=q1,price)),sum(If(start&amp;lt;=q1,price))+((q1-$(vMax))*($(vNew))))) as sum1,sum(If(start&amp;gt;q1 And start &amp;lt;=q1+q2,price)) as sum2,sum(If(start&amp;gt;q1+q2 And start &amp;lt;=q1+q2+q3,price)) as sum3,&lt;/P&gt;&lt;P&gt;sum(If(start&amp;gt;q1+q2+q3 And start &amp;lt;=q1+q2+q3+q4,price)) as sum4 Resident target Group by prod;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Sep 2014 08:08:13 GMT</pubDate>
    <dc:creator>sibideepak</dc:creator>
    <dc:date>2014-09-12T08:08:13Z</dc:date>
    <item>
      <title>not working in script</title>
      <link>https://community.qlik.com/t5/QlikView/not-working-in-script/m-p/684993#M1065122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;the following statement is working fine with text box .&lt;/P&gt;&lt;P&gt;if(q1&amp;lt;max(start),sum(If(start&amp;lt;=q1,price)),sum(If(start&amp;lt;=q1,price))+((q1-max(start))*($(vNew))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but in script loader I can't do this ..&lt;/P&gt;&lt;P&gt;help me to do the same in script loader..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Deepak sibi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2014 08:01:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/not-working-in-script/m-p/684993#M1065122</guid>
      <dc:creator>sibideepak</dc:creator>
      <dc:date>2014-09-12T08:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: not working in script</title>
      <link>https://community.qlik.com/t5/QlikView/not-working-in-script/m-p/684994#M1065123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;Is it giving some error?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2014 08:04:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/not-working-in-script/m-p/684994#M1065123</guid>
      <dc:creator>varunjain</dc:creator>
      <dc:date>2014-09-12T08:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: not working in script</title>
      <link>https://community.qlik.com/t5/QlikView/not-working-in-script/m-p/684995#M1065126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you use aggregation function(max,sum,....) in script, you have to use &lt;STRONG&gt;Group By&lt;/STRONG&gt; clause too. Perhaps you are missing that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2014 08:05:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/not-working-in-script/m-p/684995#M1065126</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-09-12T08:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: not working in script</title>
      <link>https://community.qlik.com/t5/QlikView/not-working-in-script/m-p/684996#M1065127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Error : Nested aggregation not allowed &lt;/P&gt;&lt;P&gt;my script &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Final:&lt;/P&gt;&lt;P&gt;Load prod,max(if(q1&amp;lt;max(start),sum(If(start&amp;lt;=q1,price)),sum(If(start&amp;lt;=q1,price))+((q1-$(vMax))*($(vNew))))) as sum1,sum(If(start&amp;gt;q1 And start &amp;lt;=q1+q2,price)) as sum2,sum(If(start&amp;gt;q1+q2 And start &amp;lt;=q1+q2+q3,price)) as sum3,&lt;/P&gt;&lt;P&gt;sum(If(start&amp;gt;q1+q2+q3 And start &amp;lt;=q1+q2+q3+q4,price)) as sum4 Resident target Group by prod;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2014 08:08:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/not-working-in-script/m-p/684996#M1065127</guid>
      <dc:creator>sibideepak</dc:creator>
      <dc:date>2014-09-12T08:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: not working in script</title>
      <link>https://community.qlik.com/t5/QlikView/not-working-in-script/m-p/684997#M1065130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(q1&amp;lt;max(start),sum(If(start&amp;lt;=q1,price)),sum(If(start&amp;lt;=q1,price))+((q1-max(start))*($(vNew))))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Missing the group by clause&lt;/P&gt;&lt;P&gt;2. Check the "vNew" variable&lt;/P&gt;&lt;P&gt;3. All the fields are in same table?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2014 08:09:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/not-working-in-script/m-p/684997#M1065130</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2014-09-12T08:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: not working in script</title>
      <link>https://community.qlik.com/t5/QlikView/not-working-in-script/m-p/684998#M1065133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;u cannot use aggregate functions in script laoder(sum, max,min) unless u r using a group be or it is a single column table.&lt;/P&gt;&lt;P&gt;what i would suggest is first find the max(start) in the back end like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one:&lt;/P&gt;&lt;P&gt;load max(start) as max_start&lt;/P&gt;&lt;P&gt;from table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then load it to a variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vMaxStart=peek('One',0,max_start) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then use the variable while loading the table that has price value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Sundar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2014 08:09:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/not-working-in-script/m-p/684998#M1065133</guid>
      <dc:creator>sundarakumar</dc:creator>
      <dc:date>2014-09-12T08:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: not working in script</title>
      <link>https://community.qlik.com/t5/QlikView/not-working-in-script/m-p/684999#M1065136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try using the function lastvalue() and order by in ur load script.&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2014 08:14:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/not-working-in-script/m-p/684999#M1065136</guid>
      <dc:creator />
      <dc:date>2014-09-12T08:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: not working in script</title>
      <link>https://community.qlik.com/t5/QlikView/not-working-in-script/m-p/685000#M1065138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;STRONG style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;A href="https://community.qlik.com/people/MayilVahanan"&gt;MayilVahanan&lt;/A&gt;&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vNew=sum({&amp;lt;start={$(=max(start))}&amp;gt;}price)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes , all the field are in the same table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2014 09:22:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/not-working-in-script/m-p/685000#M1065138</guid>
      <dc:creator>sibideepak</dc:creator>
      <dc:date>2014-09-12T09:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: not working in script</title>
      <link>https://community.qlik.com/t5/QlikView/not-working-in-script/m-p/685001#M1065141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to include the fields in "group by" except whose fields in aggregation function.. Instead of using nested aggregation, use preceding load with max function like sample.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for ex:&lt;/P&gt;&lt;P&gt;Load * Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;&amp;nbsp; customid, order, status&lt;/P&gt;&lt;P&gt;&amp;nbsp; C100, 10, yes&lt;/P&gt;&lt;P&gt;&amp;nbsp; C100, 20, yes&lt;/P&gt;&lt;P&gt;&amp;nbsp; C101, 10, yes&lt;/P&gt;&lt;P&gt;&amp;nbsp; C102, 50, no&lt;/P&gt;&lt;P&gt;&amp;nbsp; C103, 100, yes&lt;/P&gt;&lt;P&gt;&amp;nbsp; C104, 1000, no&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load customid,max(Sumorder) as maxorder group by customid;&lt;/P&gt;&lt;P&gt;Load customid, (if(status = 'yes',sum(order))) as Sumorder Resident Table1&lt;/P&gt;&lt;P&gt;Group by customid, status;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2014 09:46:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/not-working-in-script/m-p/685001#M1065141</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2014-09-12T09:46:36Z</dc:date>
    </item>
  </channel>
</rss>

