<?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 Using AGGR in a chart in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-AGGR-in-a-chart/m-p/367304#M136565</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;In order to calculate a Revenue in a chart, i thought i need to perform 2 steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum(aggr(Sum($(Rev)),Campaign_ID))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let say the $(Rev) is a variable with an expression that depends on the Campaign ID for its calculation.&lt;/P&gt;&lt;P&gt;So, I used the aggr(Sum($(Rev)),Campaign_ID) to calculate correctly the revenue per Campaign ID,&lt;/P&gt;&lt;P&gt;and then i used the external Sum() so the calculated revenue will be split according to the chart dimension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Example, when i use this table this expression will work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Campaign&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Revenue&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/6/12&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;250$&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;22/6/12&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;100$&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;23/6/12&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;55$&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when i use only the Date dimension in the chart, it will not work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Revenue&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/6/12&lt;/TD&gt;&lt;TD&gt;405$&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;22/6/12&lt;/TD&gt;&lt;TD&gt;0$&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i make the expression works fine regardless of the dimension i choose?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Guy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Jun 2012 15:35:59 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-06-25T15:35:59Z</dc:date>
    <item>
      <title>Using AGGR in a chart</title>
      <link>https://community.qlik.com/t5/QlikView/Using-AGGR-in-a-chart/m-p/367304#M136565</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;In order to calculate a Revenue in a chart, i thought i need to perform 2 steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum(aggr(Sum($(Rev)),Campaign_ID))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let say the $(Rev) is a variable with an expression that depends on the Campaign ID for its calculation.&lt;/P&gt;&lt;P&gt;So, I used the aggr(Sum($(Rev)),Campaign_ID) to calculate correctly the revenue per Campaign ID,&lt;/P&gt;&lt;P&gt;and then i used the external Sum() so the calculated revenue will be split according to the chart dimension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Example, when i use this table this expression will work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Campaign&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Revenue&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/6/12&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;250$&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;22/6/12&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;100$&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;23/6/12&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;55$&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when i use only the Date dimension in the chart, it will not work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Revenue&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/6/12&lt;/TD&gt;&lt;TD&gt;405$&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;22/6/12&lt;/TD&gt;&lt;TD&gt;0$&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i make the expression works fine regardless of the dimension i choose?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Guy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2012 15:35:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-AGGR-in-a-chart/m-p/367304#M136565</guid>
      <dc:creator />
      <dc:date>2012-06-25T15:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using AGGR in a chart</title>
      <link>https://community.qlik.com/t5/QlikView/Using-AGGR-in-a-chart/m-p/367305#M136566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;Use,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum(aggr(Sum($(Rev)),Campaign_ID, Date))&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;=Sum(aggr(Sum($(Rev)),Date, Campaign_ID))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need more info. A campain has... how many dates?&lt;/P&gt;&lt;P&gt;Do different campains have the same date?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;luck&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2012 15:40:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-AGGR-in-a-chart/m-p/367305#M136566</guid>
      <dc:creator>christian77</dc:creator>
      <dc:date>2012-06-25T15:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using AGGR in a chart</title>
      <link>https://community.qlik.com/t5/QlikView/Using-AGGR-in-a-chart/m-p/367306#M136567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guy Davidovich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please correct me if i'm wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are using aggr(sum(expression),diimension) to calculate revenue. &amp;amp; on above that you are using sum on this aggr result.&lt;/P&gt;&lt;P&gt;If you are doing so, may be you are approaching in a wrong way cause you are trying to use arthematic function on a arthematic function. which may not work for ur case. Can you give a try to use total function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps &amp;amp; correct me if i'm wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;&lt;P&gt;Meher&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2012 15:43:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-AGGR-in-a-chart/m-p/367306#M136567</guid>
      <dc:creator />
      <dc:date>2012-06-25T15:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using AGGR in a chart</title>
      <link>https://community.qlik.com/t5/QlikView/Using-AGGR-in-a-chart/m-p/367307#M136568</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 Problem of using the expression&lt;/P&gt;&lt;P&gt; &lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;=Sum(aggr(Sum($(Rev)),Campaign_ID, Date))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;is that is limited to Date as a dimension, and i using different dimensions (i let the user choose the dimension he likes, i think it called "flexing dimensions").&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;So, if the user choose another dimension to be shown in the chart, say Region, it will not work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;Any new suggestion?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;Guy&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2012 19:38:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-AGGR-in-a-chart/m-p/367307#M136568</guid>
      <dc:creator />
      <dc:date>2012-06-25T19:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: Using AGGR in a chart</title>
      <link>https://community.qlik.com/t5/QlikView/Using-AGGR-in-a-chart/m-p/367308#M136569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As it's not limited to dimnsion, If you let user choose a dimension dynamically, It changes your aggregate value&lt;/P&gt;&lt;P&gt;but the dimensionalities which you are using in aggr functions have must contain your chart dimension. you can ask user to select a dimension but the dimensions which you are using in chart have to be there in aggr function &amp;amp; by choosing dimension dynamically it chnages your aggr value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;&lt;P&gt;Meher&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2012 20:40:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-AGGR-in-a-chart/m-p/367308#M136569</guid>
      <dc:creator />
      <dc:date>2012-06-25T20:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using AGGR in a chart</title>
      <link>https://community.qlik.com/t5/QlikView/Using-AGGR-in-a-chart/m-p/367309#M136570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;There is a funcktion &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;GetCurrentField&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(YourGroup)&amp;nbsp;&amp;nbsp;&amp;nbsp; ///The QV color-sintax algrithm DOES NOT WORK HERE. Don't worry, it does it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(Field,&amp;lt;YourGroup&amp;gt;))&amp;nbsp; ///I don't know if this one works fine&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Think that aggregating is not easy. Try to do it with months and weeks. It will split both of them wrongly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jun 2012 07:23:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-AGGR-in-a-chart/m-p/367309#M136570</guid>
      <dc:creator>christian77</dc:creator>
      <dc:date>2012-06-26T07:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: Using AGGR in a chart</title>
      <link>https://community.qlik.com/t5/QlikView/Using-AGGR-in-a-chart/m-p/367310#M136571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I managed to do this by using expression similar to this one:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;='Sum(Aggr(Sum(PixelSum),&lt;STRONG&gt;$(=Concat(_dimension,',')&amp;amp;',Campaign_ID'&lt;/STRONG&gt;)))'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;$(=Concat(_dimension,',')&amp;amp;',Campaign_ID'&lt;/STRONG&gt; build a string consists of the fields the user chose + Campaign_ID, so the AGGR will take place with consideration of the dimensions of the charts, and still make the calculation for each Campaign.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks A lot for helping ,e get the solution!&lt;/P&gt;&lt;P&gt;Guy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jun 2012 08:51:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-AGGR-in-a-chart/m-p/367310#M136571</guid>
      <dc:creator />
      <dc:date>2012-06-26T08:51:46Z</dc:date>
    </item>
  </channel>
</rss>

