<?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: Return data from other rows in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Return-data-from-other-rows/m-p/494673#M185026</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, good luck!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Dec 2013 14:05:12 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-12-02T14:05:12Z</dc:date>
    <item>
      <title>Return data from other rows</title>
      <link>https://community.qlik.com/t5/QlikView/Return-data-from-other-rows/m-p/494669#M185022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Given the sample source table below, I am trying to find a way to populate the Value of Key=(3,4,5) with the Value from Key=2.&amp;nbsp; I am interested both in how to do this in the LOAD statement and in an expression with some sort of complex aggregation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's assume, I get the below data as not directly from the database.&amp;nbsp; How could i transform the numbers and reference the values in other records of the table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For creating this in a Chart, I have a chart with a vertical dimension of an alternatekey (essentially all 5 records below would have the same alterantekey) and a horizontal dimension of Bucket.&amp;nbsp; How do I get the value in the Alt Bucket dimension to populate with 2 from the End Bucket Dimension.&amp;nbsp; I have tried various Set Analysis expressions, but can't seem to return the value from the 'End' bucket in the 'Alt' bucket.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Key&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Type&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Bucket&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Value&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;H&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Begin&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;H&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;End&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;T&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Alt&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;T&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Alt2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;T&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Alt3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Nov 2013 22:13:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-data-from-other-rows/m-p/494669#M185022</guid>
      <dc:creator />
      <dc:date>2013-11-26T22:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: Return data from other rows</title>
      <link>https://community.qlik.com/t5/QlikView/Return-data-from-other-rows/m-p/494670#M185023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With your data set you could use the peek function on import. See example with your data below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="s1"&gt;data:&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; * &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;Inline&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;&lt;BR /&gt; &lt;/SPAN&gt;[&lt;BR /&gt; Key, Type, Bucket, Value&lt;BR /&gt; 1, H, Begin, 1&lt;BR /&gt; 2, H, End ,2&lt;BR /&gt; 3 ,T, Alt ,0&lt;BR /&gt; 4, T, Alt2, 0&lt;BR /&gt; 5, T, Alt3, 0&lt;BR /&gt; ]&lt;SPAN class="s1"&gt;;&lt;BR /&gt; &lt;BR /&gt; data_temp:&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;NoConcatenate&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; &lt;/SPAN&gt;Key&lt;SPAN class="s1"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;Type&lt;SPAN class="s1"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;Bucket&lt;SPAN class="s1"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;if&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;(&lt;/SPAN&gt;Value&lt;SPAN class="s1"&gt; = 0, &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;Peek&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;(&lt;/SPAN&gt;Value&lt;SPAN class="s1"&gt;), &lt;/SPAN&gt;Value&lt;SPAN class="s1"&gt;) &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;as&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; &lt;/SPAN&gt;Value&lt;SPAN class="s1"&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;RESIDENT&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; data;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;&lt;STRONG&gt;Drop&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;table&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; data;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;&lt;STRONG&gt;RENAME&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;table&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; data_temp &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;to&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; data &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="s1"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="s1"&gt;Hope that helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="s1"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="s1"&gt;Matt&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Nov 2013 23:27:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-data-from-other-rows/m-p/494670#M185023</guid>
      <dc:creator />
      <dc:date>2013-11-26T23:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: Return data from other rows</title>
      <link>https://community.qlik.com/t5/QlikView/Return-data-from-other-rows/m-p/494671#M185024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Mark, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Were you able to solve your problem with this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Nov 2013 16:51:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-data-from-other-rows/m-p/494671#M185024</guid>
      <dc:creator />
      <dc:date>2013-11-28T16:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Return data from other rows</title>
      <link>https://community.qlik.com/t5/QlikView/Return-data-from-other-rows/m-p/494672#M185025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Haven't had much chance to look into this due to the holidays, but a pure peek, i don't think will work, possibly with some hardcoding of ordering the sql.&amp;nbsp; although this sets me on the right path, perhaps some combination of lookup(), fieldindex(), etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another part of the problem is that an End record may not exist, in which case i need to Begin record, but that may also not exist in which case i need to do something else...&amp;nbsp; Perhaps some forced order that will represent it as above and peek at the previous records to confirm that they have the values i need.&amp;nbsp; Will need to play around with it and see what I can cobble together.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Nov 2013 15:14:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-data-from-other-rows/m-p/494672#M185025</guid>
      <dc:creator />
      <dc:date>2013-11-29T15:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Return data from other rows</title>
      <link>https://community.qlik.com/t5/QlikView/Return-data-from-other-rows/m-p/494673#M185026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, good luck!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2013 14:05:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-data-from-other-rows/m-p/494673#M185026</guid>
      <dc:creator />
      <dc:date>2013-12-02T14:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Return data from other rows</title>
      <link>https://community.qlik.com/t5/QlikView/Return-data-from-other-rows/m-p/494674#M185027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is difficult to do at the data level due to the variability of the data, but I was able to use the below to do it in the report.&amp;nbsp; the total keyword being the key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;BYA_BUCKET={'End'}&amp;gt;}TOTAL BASE_BOOK_VALUE)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 14:30:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-data-from-other-rows/m-p/494674#M185027</guid>
      <dc:creator />
      <dc:date>2013-12-09T14:30:23Z</dc:date>
    </item>
  </channel>
</rss>

