<?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 How to reference to other row's result in Pivot/Straight Table? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-reference-to-other-row-s-result-in-Pivot-Straight-Table/m-p/1014694#M344050</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;The great challenge that I face is the following:&lt;/P&gt;&lt;P&gt;I'd need to find the best publication type as per "Seasons", which is basically the one with the lowest CPC (cost per clik).&lt;/P&gt;&lt;P&gt;If we have that, than we'd need to compare that to the actual CPC and see the difference (when this is multiplied by impression figures, you'd get possible saved amount)&lt;/P&gt;&lt;P&gt;See example below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/114323_pastedImage_1.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, if we see Type 1 as an example - circled in red - you can see that I got 30 (20+10) CPCs with Pub1 publication, whereas Pub2 publication has 60 CPC.&lt;/P&gt;&lt;P&gt;That is an expensive solution, therefore in the "mistery calc" I would need to see, how the actual CPC varies from the minimum CPC as per Publications. Following the example you would see:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Row 1: 0 (as this is the cheapest solution)&lt;/P&gt;&lt;P&gt;Row 2: 10 (as it has a CPC that is higher with 10)&lt;/P&gt;&lt;P&gt;Row 3: 50 (highest value, biggest saving opp)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Blue example - following the same logic:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Row 4: 10&lt;/P&gt;&lt;P&gt;Row 5: 20&lt;/P&gt;&lt;P&gt;Row 6: 0 (most optimal solution for Type 2 Season, using Publication as group&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions on the expression?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;Tamas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Feb 2016 13:14:19 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-02-11T13:14:19Z</dc:date>
    <item>
      <title>How to reference to other row's result in Pivot/Straight Table?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-reference-to-other-row-s-result-in-Pivot-Straight-Table/m-p/1014694#M344050</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;The great challenge that I face is the following:&lt;/P&gt;&lt;P&gt;I'd need to find the best publication type as per "Seasons", which is basically the one with the lowest CPC (cost per clik).&lt;/P&gt;&lt;P&gt;If we have that, than we'd need to compare that to the actual CPC and see the difference (when this is multiplied by impression figures, you'd get possible saved amount)&lt;/P&gt;&lt;P&gt;See example below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/114323_pastedImage_1.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, if we see Type 1 as an example - circled in red - you can see that I got 30 (20+10) CPCs with Pub1 publication, whereas Pub2 publication has 60 CPC.&lt;/P&gt;&lt;P&gt;That is an expensive solution, therefore in the "mistery calc" I would need to see, how the actual CPC varies from the minimum CPC as per Publications. Following the example you would see:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Row 1: 0 (as this is the cheapest solution)&lt;/P&gt;&lt;P&gt;Row 2: 10 (as it has a CPC that is higher with 10)&lt;/P&gt;&lt;P&gt;Row 3: 50 (highest value, biggest saving opp)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Blue example - following the same logic:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Row 4: 10&lt;/P&gt;&lt;P&gt;Row 5: 20&lt;/P&gt;&lt;P&gt;Row 6: 0 (most optimal solution for Type 2 Season, using Publication as group&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions on the expression?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;Tamas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2016 13:14:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-reference-to-other-row-s-result-in-Pivot-Straight-Table/m-p/1014694#M344050</guid>
      <dc:creator />
      <dc:date>2016-02-11T13:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference to other row's result in Pivot/Straight Table?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-reference-to-other-row-s-result-in-Pivot-Straight-Table/m-p/1014695#M344051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps this: sum(CPC) - min(aggr(sum(CPC),Country,Segment,Season,Publication))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2016 16:32:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-reference-to-other-row-s-result-in-Pivot-Straight-Table/m-p/1014695#M344051</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-02-11T16:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference to other row's result in Pivot/Straight Table?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-reference-to-other-row-s-result-in-Pivot-Straight-Table/m-p/1014696#M344052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the quick reply Gysbert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was thinking the same, however, wouldn't it make sense to use min instead of sum within the aggr function?&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;min&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;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;min&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;CPC&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Country&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Segment&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Season&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Publication&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Anyway, the aggr returns back the optimal value, BUT only at the actual row where it sits. At other records it shows NULL. See screenshot below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/114396_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I make the value 10 appear in each and every related rows (in this case the first two)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Feb 2016 08:34:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-reference-to-other-row-s-result-in-Pivot-Straight-Table/m-p/1014696#M344052</guid>
      <dc:creator />
      <dc:date>2016-02-12T08:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference to other row's result in Pivot/Straight Table?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-reference-to-other-row-s-result-in-Pivot-Straight-Table/m-p/1014697#M344053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe, but I can't know if your CPC expression is already a sum aggregation or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this one: sum(CPC) - min(aggr(nodistinct sum(CPC),Country,Segment,Season,Publication))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Feb 2016 17:29:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-reference-to-other-row-s-result-in-Pivot-Straight-Table/m-p/1014697#M344053</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-02-12T17:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference to other row's result in Pivot/Straight Table?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-reference-to-other-row-s-result-in-Pivot-Straight-Table/m-p/1014698#M344054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gysbert, I cannot express my gratitude!&lt;/P&gt;&lt;P&gt;CPC indeed has a sum aggregation so I had to use min, but the framework itself works!&lt;/P&gt;&lt;P&gt;Thanks a bunch!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tamas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Feb 2016 08:16:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-reference-to-other-row-s-result-in-Pivot-Straight-Table/m-p/1014698#M344054</guid>
      <dc:creator />
      <dc:date>2016-02-15T08:16:18Z</dc:date>
    </item>
  </channel>
</rss>

