<?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: Aggregate function in num() under script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045130#M351380</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You still have not taken POS_TYPE in group by, try adding that to you group by:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;LOAD if(POS_TYPE='Posted',num(sum(NETNOTIONAL)*-1,'###,###,###.##'),sum(NETNOTIONAL)) as NETNOTIONAL,&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;GroupKeyPositionTypeIsssueId&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Resident CollateralPositions&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Group by GroupKeyPositionTypeIsssueId, &lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;POS_TYPE&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Feb 2016 20:40:59 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-02-03T20:40:59Z</dc:date>
    <item>
      <title>Aggregate function in num() under script</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045126#M351376</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;I'm facing syntax error while trying to reload after the below expression under Qlikview script,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(POS_TYPE='Posted',num(sum(NOTIONAL)*-1,'###,###,###.##'),sum( ! !NOTIONAL)) as NETNOTIONAL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest the correct syntax or way forward for the same rather than implementing in UI and I have to use&amp;nbsp; in script only.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2016 19:14:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045126#M351376</guid>
      <dc:creator />
      <dc:date>2016-02-03T19:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate function in num() under script</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045127#M351377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry, below is the expression,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(POS_TYPE='Posted',num(sum(NOTIONAL)*-1,'###,###,###.##'),sum(NOTIONAL)) as NETNOTIONAL&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2016 19:17:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045127#M351377</guid>
      <dc:creator />
      <dc:date>2016-02-03T19:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate function in num() under script</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045128#M351378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using a Group By statement in your load? If you have additional fields such as POS_TYPE which are not getting aggregated, you need to use Group By Statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2016 19:39:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045128#M351378</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-02-03T19:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate function in num() under script</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045129#M351379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes Sunny, below is the sample code I'm trying for with group by only, but even still throwing expression error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD *,AutoNumberHash128(POS_TYPE,PRIMARYINSTRUMENTIDENTIFIER) as GroupKeyPositionTypeIsssueId&lt;/P&gt;&lt;P&gt;Resident COLLATERALPOSITIONS;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Concatenate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD if(POS_TYPE='Posted',num(sum(NETNOTIONAL)*-1,'###,###,###.##'),sum(NETNOTIONAL)) as NETNOTIONAL,&lt;/P&gt;&lt;P&gt;GroupKeyPositionTypeIsssueId&lt;/P&gt;&lt;P&gt;Resident CollateralPositions&lt;/P&gt;&lt;P&gt;Group by GroupKeyPositionTypeIsssueId;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2016 20:04:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045129#M351379</guid>
      <dc:creator />
      <dc:date>2016-02-03T20:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate function in num() under script</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045130#M351380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You still have not taken POS_TYPE in group by, try adding that to you group by:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;LOAD if(POS_TYPE='Posted',num(sum(NETNOTIONAL)*-1,'###,###,###.##'),sum(NETNOTIONAL)) as NETNOTIONAL,&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;GroupKeyPositionTypeIsssueId&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Resident CollateralPositions&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Group by GroupKeyPositionTypeIsssueId, &lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;POS_TYPE&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2016 20:40:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045130#M351380</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-02-03T20:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate function in num() under script</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045131#M351381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks sunny, it worked for one condition, but fails at below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD if(VALUATIONPERCENTAGE=0 or VALUATIONPERCENTAGE=100,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(POSITIONTYPE='Held',num(sum(MARKETVALUEAGREEMENT),'###,###,###.##'),num(sum(MARKETVALUEAGREEMENT)*-1,'###,###,###.##')),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(POSITIONTYPE='Held',num(MARKETVALUEAGREEMENT-(MARKETVALUEAGREEMENT*VALUATIONPERCENTAGE/100),'###,###,###.##'),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; num(sum(MARKETVALUEAGREEMENT)*-1-(MARKETVALUEAGREEMENT*VALUATIONPERCENTAGE/100),'###,###,###.##'))) as AdjPV,&lt;/P&gt;&lt;P&gt;GroupKeyPositionTypeIsssueId&lt;/P&gt;&lt;P&gt;Resident CollateralPositions&lt;/P&gt;&lt;P&gt;Group by GroupKeyPositionTypeIsssueId,POSITIONTYPE;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2016 21:21:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045131#M351381</guid>
      <dc:creator />
      <dc:date>2016-02-03T21:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate function in num() under script</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045132#M351382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now you added other non-aggregated fields, so you will need them in Group by as well:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD if(VALUATIONPERCENTAGE=0 or VALUATIONPERCENTAGE=100,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(POSITIONTYPE='Held',num(sum(MARKETVALUEAGREEMENT),'###,###,###.##'),num(sum(MARKETVALUEAGREEMENT)*-1,'###,###,###.##')),&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(POSITIONTYPE='Held',num(MARKETVALUEAGREEMENT-(MARKETVALUEAGREEMENT*VALUATIONPERCENTAGE/100),'###,###,###.##'),&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; num(sum(MARKETVALUEAGREEMENT)*-1-(MARKETVALUEAGREEMENT*VALUATIONPERCENTAGE/100),'###,###,###.##'))) as AdjPV,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;GroupKeyPositionTypeIsssueId&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Resident CollateralPositions&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Group by GroupKeyPositionTypeIsssueId,POSITIONTYPE&lt;STRONG&gt;, &lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;MARKETVALUEAGREEMENT, &lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;VALUATIONPERCENTAGE&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2016 21:31:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045132#M351382</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-02-03T21:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate function in num() under script</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045133#M351383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks much Sunny, now its got executed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2016 23:29:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045133#M351383</guid>
      <dc:creator />
      <dc:date>2016-02-03T23:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate function in num() under script</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045134#M351384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is getting executed is a different thing then getting the right output. Are you getting the right number after the execution complete? I have feeling you are not, but if you are then its great.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case everything is good, do you mind closing this thread down by marking correct and helpful answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Feb 2016 09:26:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045134#M351384</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-02-04T09:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate function in num() under script</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045135#M351385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You rightly said I'm not getting the expected result can you shade me any suggestions or sample example to get it corrected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Feb 2016 14:39:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045135#M351385</guid>
      <dc:creator />
      <dc:date>2016-02-04T14:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate function in num() under script</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045136#M351386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you might have to aggregate each of them in different&amp;nbsp; resident loads as my guess is that you are aggregating them on different levels. If you can share some data with expected output, I might be able to help you resolve your issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Feb 2016 17:58:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045136#M351386</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-02-04T17:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate function in num() under script</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045137#M351387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks sunny, I did aggregation&amp;nbsp; in different resident loads, now I got the result which I'm expecting,thanks much once again for your prompt response which really helped to resolve the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2016 02:35:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045137#M351387</guid>
      <dc:creator />
      <dc:date>2016-02-05T02:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate function in num() under script</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045138#M351388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome, I am glad it finally worked out for you. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2016 18:00:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-function-in-num-under-script/m-p/1045138#M351388</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-02-05T18:00:35Z</dc:date>
    </item>
  </channel>
</rss>

