<?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: sum(aggr(only( expression returns a 0 when used with ValueList in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/sum-aggr-only-expression-returns-a-0-when-used-with-ValueList/m-p/1683413#M593805</link>
    <description>&lt;P&gt;Look here for why this happens and possible solutions&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.naturalsynergies.com/q-tip-14-aggr-and-synthetic-dimensions/" target="_blank" rel="noopener"&gt;AGGR() and Synthetic Dimensions&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Mar 2020 16:22:11 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2020-03-10T16:22:11Z</dc:date>
    <item>
      <title>sum(aggr(only( expression returns a 0 when used with ValueList</title>
      <link>https://community.qlik.com/t5/QlikView/sum-aggr-only-expression-returns-a-0-when-used-with-ValueList/m-p/1682977#M593804</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to create a straight table with ValueList and some expressions:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="table.PNG" style="width: 294px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/29769i4C793C59D4F9F730/image-size/medium?v=v2&amp;amp;px=400" role="button" title="table.PNG" alt="table.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Distance and Season Average are the ValueList Dimension.&lt;/P&gt;&lt;P&gt;The expressions I have is:&lt;/P&gt;&lt;P&gt;For Season Average:&lt;/P&gt;&lt;P&gt;=if(valuelist('Distance','Season Average')='Season Average',sum({&amp;lt;HOME_TEAM_NAME = , AWAY_TEAM_NAME&amp;gt;}aggr(Only({&amp;lt;PLAYERTEAMNAME2={'$(vTeam2)'},PRIMARY_POS_DESC={'Defender','Midfielder','Forward'},HOME_TEAM_NAME = , AWAY_TEAM_NAME = &amp;gt;} MAX_METERS),MAX_METERS))/&lt;/P&gt;&lt;P&gt;(count(DISTINCT{1&amp;lt;TEAM_NAME={'$(vTeam2)'},PRIMARY_POS_DESC={'Defender','Midfielder','Forward'}&amp;gt;} GAME_CODE)),&lt;/P&gt;&lt;P&gt;For Distance:&lt;/P&gt;&lt;P&gt;if(valuelist('Distance','Season Average')='Distance',sum(aggr(sum(DISTINCT{&amp;lt;PLAYER_ID=,PRIMARY_POS_DESC-={'Goalkeeper'},PLAYERTEAMNAME=[AWAY_TEAM_NAME]&amp;gt;}MAX_METERS),PLAYER_ID))))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only part of the expression returning 0 is the first half of the top expression:&lt;/P&gt;&lt;P&gt;sum({&amp;lt;HOME_TEAM_NAME = , AWAY_TEAM_NAME&amp;gt;}aggr(Only({&amp;lt;PLAYERTEAMNAME2={'$(vTeam2)'},PRIMARY_POS_DESC={'Defender','Midfielder','Forward'},HOME_TEAM_NAME = , AWAY_TEAM_NAME = &amp;gt;} MAX_METERS),MAX_METERS))&lt;/P&gt;&lt;P&gt;On its own it works perfectly. It is divided by&amp;nbsp;&lt;/P&gt;&lt;P&gt;(count(DISTINCT{1&amp;lt;TEAM_NAME={'$(vTeam2)'},PRIMARY_POS_DESC={'Defender','Midfielder','Forward'}&amp;gt;} GAME_CODE))&lt;/P&gt;&lt;P&gt;which also happens to work perfectly if used in the Valuelist expression with the first part commented out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone tell me why adding this first expression to ValueList is causing the 0 result?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 16:17:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-aggr-only-expression-returns-a-0-when-used-with-ValueList/m-p/1682977#M593804</guid>
      <dc:creator>AyCe1082</dc:creator>
      <dc:date>2020-03-09T16:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: sum(aggr(only( expression returns a 0 when used with ValueList</title>
      <link>https://community.qlik.com/t5/QlikView/sum-aggr-only-expression-returns-a-0-when-used-with-ValueList/m-p/1683413#M593805</link>
      <description>&lt;P&gt;Look here for why this happens and possible solutions&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.naturalsynergies.com/q-tip-14-aggr-and-synthetic-dimensions/" target="_blank" rel="noopener"&gt;AGGR() and Synthetic Dimensions&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2020 16:22:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-aggr-only-expression-returns-a-0-when-used-with-ValueList/m-p/1683413#M593805</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2020-03-10T16:22:11Z</dc:date>
    </item>
  </channel>
</rss>

