<?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 Sum Cost per Context in relation to Target in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-Cost-per-Context-in-relation-to-Target/m-p/1645297#M731277</link>
    <description>&lt;P&gt;Hello *,&lt;/P&gt;&lt;P&gt;I have a simple scenario but can not find a working solution.&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="CostExample.png" style="width: 359px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/23330i3EBD9115A476BE5C/image-size/large?v=v2&amp;amp;px=999" role="button" title="CostExample.png" alt="CostExample.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want Qlikview to show for dimension product how much is &lt;STRONG&gt;on/above/under&lt;/STRONG&gt; target.&lt;BR /&gt;So expected result for car &lt;STRONG&gt;230/40/70&lt;/STRONG&gt; and for bike &lt;STRONG&gt;260/40/60&lt;/STRONG&gt;.&lt;BR /&gt;I tried it with aggr in expression but it always sums over product.&lt;BR /&gt;That means I want to calculate on customer level and sum the results on product level.&lt;/P&gt;&lt;P&gt;Expression for OnTarget:&lt;/P&gt;&lt;P&gt;IF(SUM(Aggr(SUM(Cost_Real)&amp;lt;=SUM(Cost_Target),Customer,Product)),&lt;BR /&gt;SUM(Aggr(SUM(Cost_Real),Customer,Product)),&lt;BR /&gt;SUM(Aggr(SUM(Cost_Target),Customer,Product)))&lt;/P&gt;&lt;P&gt;Do you have any idea?&lt;/P&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>oldshoe</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Sum Cost per Context in relation to Target</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-Cost-per-Context-in-relation-to-Target/m-p/1645297#M731277</link>
      <description>&lt;P&gt;Hello *,&lt;/P&gt;&lt;P&gt;I have a simple scenario but can not find a working solution.&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="CostExample.png" style="width: 359px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/23330i3EBD9115A476BE5C/image-size/large?v=v2&amp;amp;px=999" role="button" title="CostExample.png" alt="CostExample.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want Qlikview to show for dimension product how much is &lt;STRONG&gt;on/above/under&lt;/STRONG&gt; target.&lt;BR /&gt;So expected result for car &lt;STRONG&gt;230/40/70&lt;/STRONG&gt; and for bike &lt;STRONG&gt;260/40/60&lt;/STRONG&gt;.&lt;BR /&gt;I tried it with aggr in expression but it always sums over product.&lt;BR /&gt;That means I want to calculate on customer level and sum the results on product level.&lt;/P&gt;&lt;P&gt;Expression for OnTarget:&lt;/P&gt;&lt;P&gt;IF(SUM(Aggr(SUM(Cost_Real)&amp;lt;=SUM(Cost_Target),Customer,Product)),&lt;BR /&gt;SUM(Aggr(SUM(Cost_Real),Customer,Product)),&lt;BR /&gt;SUM(Aggr(SUM(Cost_Target),Customer,Product)))&lt;/P&gt;&lt;P&gt;Do you have any idea?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-Cost-per-Context-in-relation-to-Target/m-p/1645297#M731277</guid>
      <dc:creator>oldshoe</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Sum Cost per Context in relation to Target</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-Cost-per-Context-in-relation-to-Target/m-p/1645350#M731278</link>
      <description>&lt;P&gt;How are you getting these numbers?&amp;nbsp;&lt;SPAN&gt;for car&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;230/40/70&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;and for bike&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;260/40/60&lt;/STRONG&gt; from the sample data that you have shared? can you explain which rows are getting added to get 230, 40 and 70 for cars?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 13:25:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-Cost-per-Context-in-relation-to-Target/m-p/1645350#M731278</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-11-11T13:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Sum Cost per Context in relation to Target</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-Cost-per-Context-in-relation-to-Target/m-p/1645408#M731279</link>
      <description>&lt;P&gt;Hi Sunny, thanks for your answer.&lt;/P&gt;&lt;P&gt;Here is the calculation for cars:&lt;/P&gt;&lt;P&gt;OnTarget : IF (Cost_Real &amp;lt;= Cost_Target , Cost_Real, Cost_Target)&lt;/P&gt;&lt;P&gt;= C2 + C3 + D4 = 100+30+100 = 230&lt;/P&gt;&lt;P&gt;AboveTarget: IF (Cost_Real &amp;gt; Cost_Target, Cost_Target-Cost_Real,0)&lt;/P&gt;&lt;P&gt;=C4-D4 = 140-100 = 40&lt;/P&gt;&lt;P&gt;UnderTarget: IF (Cost_Real &amp;lt; Cost_Target, Cost_Target-Cost_Real,0)&lt;/P&gt;&lt;P&gt;= D3-C3 = 100-30 = 70&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 14:26:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-Cost-per-Context-in-relation-to-Target/m-p/1645408#M731279</guid>
      <dc:creator>oldshoe</dc:creator>
      <dc:date>2019-11-11T14:26:31Z</dc:date>
    </item>
    <item>
      <title>Re: Sum Cost per Context in relation to Target</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-Cost-per-Context-in-relation-to-Target/m-p/1645476#M731280</link>
      <description>&lt;P&gt;May be this&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;OnTarget&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sum(Aggr(
  RangeMin(Sum(Cost_Real), Sum(Cost_Target))
, Customer, Product))&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;AboveTarget&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sum(Aggr(
  RangeMax(Sum(Cost_Real)- Sum(Cost_Target), 0)
, Customer_Product))&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;UnderTarget&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sum(Aggr(
  RangeMax(Sum(Cost_Target)- Sum(Cost_Real), 0)
, Customer_Product))&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 11 Nov 2019 16:09:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-Cost-per-Context-in-relation-to-Target/m-p/1645476#M731280</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-11-11T16:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: Sum Cost per Context in relation to Target</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-Cost-per-Context-in-relation-to-Target/m-p/1645721#M731281</link>
      <description>&lt;P&gt;Yeah! This works! Thank you so much!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2019 09:21:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-Cost-per-Context-in-relation-to-Target/m-p/1645721#M731281</guid>
      <dc:creator>oldshoe</dc:creator>
      <dc:date>2019-11-12T09:21:10Z</dc:date>
    </item>
  </channel>
</rss>

