<?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: Dynamically using a dimension inside an aggregate (aggr) in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Dynamically-using-a-dimension-inside-an-aggregate-aggr/m-p/1565256#M41165</link>
    <description>&lt;PRE&gt;Not tried but what if you try like this by moving if condition in the Place variable. - &lt;BR /&gt;&lt;BR /&gt;=AVG(
    	total Aggr(
        	sum(Total),'$(Place)'&lt;BR /&gt;              )
    )&lt;/PRE&gt;</description>
    <pubDate>Thu, 04 Apr 2019 14:32:43 GMT</pubDate>
    <dc:creator>Digvijay_Singh</dc:creator>
    <dc:date>2019-04-04T14:32:43Z</dc:date>
    <item>
      <title>Dynamically using a dimension inside an aggregate (aggr)</title>
      <link>https://community.qlik.com/t5/App-Development/Dynamically-using-a-dimension-inside-an-aggregate-aggr/m-p/1565242#M41164</link>
      <description>&lt;P&gt;Hi everyone , I am currently trying to change the column used in a aggregate based on a variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I have tried so far :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;=AVG(
    	total Aggr(
        	sum(Total),
           	if(Place = 'Country', Country, State)
       )
    )&lt;/PRE&gt;&lt;P&gt;and&lt;/P&gt;&lt;PRE&gt;=AVG(
    	total Aggr(
        	sum(Total),
           	if('$(Place)' = 'Country', Country, State)
       )
    )&lt;/PRE&gt;&lt;P&gt;Where Total, Country and State are columns, and Place a variable.&lt;/P&gt;&lt;P&gt;Note that if I remove the If and use specifically Coutry or State, there is no problem.&lt;/P&gt;&lt;P&gt;I have made sure that the variable has a value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any way to dynamically specify the dimension in the aggregate function?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 06:09:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dynamically-using-a-dimension-inside-an-aggregate-aggr/m-p/1565242#M41164</guid>
      <dc:creator>pierreolivier</dc:creator>
      <dc:date>2024-11-16T06:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically using a dimension inside an aggregate (aggr)</title>
      <link>https://community.qlik.com/t5/App-Development/Dynamically-using-a-dimension-inside-an-aggregate-aggr/m-p/1565256#M41165</link>
      <description>&lt;PRE&gt;Not tried but what if you try like this by moving if condition in the Place variable. - &lt;BR /&gt;&lt;BR /&gt;=AVG(
    	total Aggr(
        	sum(Total),'$(Place)'&lt;BR /&gt;              )
    )&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Apr 2019 14:32:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dynamically-using-a-dimension-inside-an-aggregate-aggr/m-p/1565256#M41165</guid>
      <dc:creator>Digvijay_Singh</dc:creator>
      <dc:date>2019-04-04T14:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically using a dimension inside an aggregate (aggr)</title>
      <link>https://community.qlik.com/t5/App-Development/Dynamically-using-a-dimension-inside-an-aggregate-aggr/m-p/1565267#M41166</link>
      <description>&lt;P&gt;We ended up renaming the columns to be the exact name that we used in the variables. Heres what ended up working :&lt;/P&gt;&lt;PRE&gt;=
AVG(total 
  Aggr(
    sum(Total),
    [$(Place)]
  )
)&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Apr 2019 14:50:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dynamically-using-a-dimension-inside-an-aggregate-aggr/m-p/1565267#M41166</guid>
      <dc:creator>pierreolivier</dc:creator>
      <dc:date>2019-04-04T14:50:03Z</dc:date>
    </item>
  </channel>
</rss>

