<?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 Peek Help - Groups and First Row Values in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Peek-Help-Groups-and-First-Row-Values/m-p/1061104#M641587</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, I am having some problems with Peek. I have researched across the boards but cannot find the final pieces to solve this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Essentially I am trying to calculate a monthly change % value from the field 'UV_AMT' (see excel / Qlik file attached). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UV_AMT represents the month by month value of an account (denoted by first column 'PERF_GRP_KEY'). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this dummy file I have duplicated the first account and renamed EG00002 so I can test what would happen with multiple entries (my main DB has 1,000s of these 'EGs'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to create the PCT_RTN_BR calculation using the formula:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (UV_AMT - Peek(UV_AMT,-1)) / Peek(UV_AMT,-1) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to match this with the column PCT_RTN_EXCEL_CALC which is the value calculated in excel manually. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above formula works for all but the following 2 cases: &lt;/P&gt;&lt;P&gt;1 - very first row of the table, I get a value of null instead of '0'&lt;/P&gt;&lt;P&gt;2 - where the data switches to EG0002 the Peek is picking up the last row on the previous EG. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to solve using GROUP clause on PERF_GRP_KEY but could not make it work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help much appreciated! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Mar 2016 14:08:03 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-03-01T14:08:03Z</dc:date>
    <item>
      <title>Peek Help - Groups and First Row Values</title>
      <link>https://community.qlik.com/t5/QlikView/Peek-Help-Groups-and-First-Row-Values/m-p/1061104#M641587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, I am having some problems with Peek. I have researched across the boards but cannot find the final pieces to solve this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Essentially I am trying to calculate a monthly change % value from the field 'UV_AMT' (see excel / Qlik file attached). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UV_AMT represents the month by month value of an account (denoted by first column 'PERF_GRP_KEY'). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this dummy file I have duplicated the first account and renamed EG00002 so I can test what would happen with multiple entries (my main DB has 1,000s of these 'EGs'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to create the PCT_RTN_BR calculation using the formula:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (UV_AMT - Peek(UV_AMT,-1)) / Peek(UV_AMT,-1) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to match this with the column PCT_RTN_EXCEL_CALC which is the value calculated in excel manually. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above formula works for all but the following 2 cases: &lt;/P&gt;&lt;P&gt;1 - very first row of the table, I get a value of null instead of '0'&lt;/P&gt;&lt;P&gt;2 - where the data switches to EG0002 the Peek is picking up the last row on the previous EG. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to solve using GROUP clause on PERF_GRP_KEY but could not make it work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help much appreciated! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 14:08:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Peek-Help-Groups-and-First-Row-Values/m-p/1061104#M641587</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-01T14:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: Peek Help - Groups and First Row Values</title>
      <link>https://community.qlik.com/t5/QlikView/Peek-Help-Groups-and-First-Row-Values/m-p/1061105#M641588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As per my understanding , if account switches to new values you need to start from 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IF( AcctName = Previous(AcctName) , (UV_AMT - Previous(UV_AMT))/Previous(UV_AMT) , 0 )&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 14:13:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Peek-Help-Groups-and-First-Row-Values/m-p/1061105#M641588</guid>
      <dc:creator />
      <dc:date>2016-03-01T14:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Peek Help - Groups and First Row Values</title>
      <link>https://community.qlik.com/t5/QlikView/Peek-Help-Groups-and-First-Row-Values/m-p/1061106#M641589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Absolutely - seems to work!! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Much cleaner than using Peek too - many thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 14:17:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Peek-Help-Groups-and-First-Row-Values/m-p/1061106#M641589</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-01T14:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: Peek Help - Groups and First Row Values</title>
      <link>https://community.qlik.com/t5/QlikView/Peek-Help-Groups-and-First-Row-Values/m-p/1061107#M641590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Used above in the expression to get the same results. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 14:34:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Peek-Help-Groups-and-First-Row-Values/m-p/1061107#M641590</guid>
      <dc:creator />
      <dc:date>2016-03-01T14:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Peek Help - Groups and First Row Values</title>
      <link>https://community.qlik.com/t5/QlikView/Peek-Help-Groups-and-First-Row-Values/m-p/1061108#M641591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dathu - I wonder if you may be able to advise me further - I implemented the code in my master DB but it did not work. In most of the case the % calculated correctly, but not always. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added a new column to my output looking at just Previous(UV_AMT) and the results look like they are coming through in the wrong order. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there something I can add to make sure it is all considered in sequence of month end date (assuming that is what is happening)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 20:34:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Peek-Help-Groups-and-First-Row-Values/m-p/1061108#M641591</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-01T20:34:14Z</dc:date>
    </item>
  </channel>
</rss>

