<?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 Previous Dimension Value In Straight Table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Previous-Dimension-Value-In-Straight-Table/m-p/331573#M122182</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; My goal was to do this in a dimension, instead of loading millions of records into the QlikView DB.&amp;nbsp; I was unable to come up with a way to do this in the dimension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I ended up doing was something similar to what Brandon had in the post above.&amp;nbsp; I brought in all 4+ million records using outer join (yuck), then in my script sorted this how it needed to be sorted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I made another pass, and brought back my division field as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(Division &amp;gt; '', Division, PEEK('Division', RowNo() - 2)) as Division&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I originally thought I could use the 'Previous' function in my script, but this only got the previous record from my originating data source, and not the rows as they were created.&amp;nbsp; Peek seemed to take care of this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 May 2012 16:35:16 GMT</pubDate>
    <dc:creator>joshabbott</dc:creator>
    <dc:date>2012-05-02T16:35:16Z</dc:date>
    <item>
      <title>Previous Dimension Value In Straight Table</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Dimension-Value-In-Straight-Table/m-p/331571#M122180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a straight table that has data like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Division Sales&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100&lt;/P&gt;&lt;P&gt;null&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200&lt;/P&gt;&lt;P&gt;null&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 50&lt;/P&gt;&lt;P&gt;B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 44&lt;/P&gt;&lt;P&gt;null&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 33&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'm looking for is a way in the straight table to get the previous row's dimension value.&amp;nbsp; For instance, row 1 above has an A for division, but rows 2 and 3 are null, I would like both of them to be A.&amp;nbsp; Row 4 has a B value but row 5 is null, I would like this to be B.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could someone help me?&amp;nbsp; I'm just give a very small sample set of this data, I understand you can use a previous in the script, but I would prefer not to go that direction as it would create millions of extra rows in my situation.&amp;nbsp; Thank you for any help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Josh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2012 12:08:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Dimension-Value-In-Straight-Table/m-p/331571#M122180</guid>
      <dc:creator>joshabbott</dc:creator>
      <dc:date>2012-05-02T12:08:22Z</dc:date>
    </item>
    <item>
      <title>Previous Dimension Value In Straight Table</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Dimension-Value-In-Straight-Table/m-p/331572#M122181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can accomplish this using the peek function, which pulls up the previous entries value in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the script you would have:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;LOAD * Inline [&lt;/P&gt;&lt;P&gt;Division, Sales&lt;/P&gt;&lt;P&gt;A, 100&lt;/P&gt;&lt;P&gt;null, 200&lt;/P&gt;&lt;P&gt;null, 50&lt;/P&gt;&lt;P&gt;B, 44&lt;/P&gt;&lt;P&gt;null, 33&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp1:&lt;/P&gt;&lt;P&gt;LOAD Sales,&lt;/P&gt;&lt;P&gt;IF((Division='null'),peek(Division),Division) as Division,&lt;/P&gt;&lt;P&gt;' ' as Junk&lt;/P&gt;&lt;P&gt;Resident Temp;&lt;/P&gt;&lt;P&gt;drop table Temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only chances are you would have an actual null value in Division rather than the string null so your IF statement would go like this:&lt;/P&gt;&lt;P&gt;IF(isNull(Division),peek(Division),Division) as Division,&lt;/P&gt;&lt;P&gt;&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;-Brandon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2012 16:22:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Dimension-Value-In-Straight-Table/m-p/331572#M122181</guid>
      <dc:creator />
      <dc:date>2012-05-02T16:22:28Z</dc:date>
    </item>
    <item>
      <title>Previous Dimension Value In Straight Table</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Dimension-Value-In-Straight-Table/m-p/331573#M122182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; My goal was to do this in a dimension, instead of loading millions of records into the QlikView DB.&amp;nbsp; I was unable to come up with a way to do this in the dimension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I ended up doing was something similar to what Brandon had in the post above.&amp;nbsp; I brought in all 4+ million records using outer join (yuck), then in my script sorted this how it needed to be sorted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I made another pass, and brought back my division field as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(Division &amp;gt; '', Division, PEEK('Division', RowNo() - 2)) as Division&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I originally thought I could use the 'Previous' function in my script, but this only got the previous record from my originating data source, and not the rows as they were created.&amp;nbsp; Peek seemed to take care of this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2012 16:35:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Dimension-Value-In-Straight-Table/m-p/331573#M122182</guid>
      <dc:creator>joshabbott</dc:creator>
      <dc:date>2012-05-02T16:35:16Z</dc:date>
    </item>
  </channel>
</rss>

