<?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: Functions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Functions/m-p/851248#M993010</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;does this help you Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Jul 2015 15:37:56 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-07-10T15:37:56Z</dc:date>
    <item>
      <title>Functions</title>
      <link>https://community.qlik.com/t5/QlikView/Functions/m-p/851245#M993004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; How to use peek,previous in functions script level?explain with example?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 15:19:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Functions/m-p/851245#M993004</guid>
      <dc:creator>qlikview979</dc:creator>
      <dc:date>2015-07-10T15:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: Functions</title>
      <link>https://community.qlik.com/t5/QlikView/Functions/m-p/851246#M993006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-top: 12.0pt; margin-bottom: 12.0pt; background: white;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;The &lt;SPAN style="background: yellow;"&gt;Peek&lt;/SPAN&gt;&amp;nbsp; function is an inter-record function that allows us to literally peek into previously-read records of a table and use its values to evaluate a condition or to affect the active record (the one being read).&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 12.0pt; margin-bottom: 12.0pt; background: white;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;The function takes one mandatory parameter, the field name into which we will "peek", and two optional parameters, a row reference and the table in which the field is located.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 12.0pt; margin-bottom: 12.0pt; background: white;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;For example, an expression like:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Helvetica','sans-serif'; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.&amp;nbsp;&amp;nbsp; Peek('Date', -2) :&amp;gt;&amp;gt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;This expression will go back two records in the currently-being-read table, take the value on the Date field and use it as a result of the expression.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'inherit','serif'; color: black;"&gt; 2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; peek( 'Price', 2 )&amp;nbsp; :&amp;gt;&amp;gt;&amp;gt; It &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;returns the value of &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'inherit','serif'; color: black;"&gt;Price&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt; from the third record read from the current internal table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt; background-position: initial;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt; 3.&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;peek( 'Price', 0, 'Tab1' ) :&amp;gt;&amp;gt;&amp;gt; It &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;returns the value of &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'inherit','serif'; color: black;"&gt;Price &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;from the first record read into the input table labeled Tab1.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: yellow;"&gt;Previous Function:&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Helvetica','sans-serif'; color: #3d3d3d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: #F5FAF0;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Helvetica','sans-serif'; color: #3d3d3d;"&gt;There are certainly some similarities between the two functions but there are also distinct differences that need to be taken into account when deciding which function to use.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: #F5FAF0;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Helvetica','sans-serif'; color: #3d3d3d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: #F5FAF0;"&gt;&lt;STRONG style="color: #3d3d3d; font-size: 10.0pt; font-family: 'inherit','serif';"&gt;The Similarities&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: #F5FAF0;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Helvetica','sans-serif'; color: #3d3d3d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'inherit','serif'; color: #3d3d3d;"&gt;Both allow you to look back at previously loaded rows in a table.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="margin-bottom: .0001pt; background: #F5FAF0;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Helvetica','sans-serif'; color: #3d3d3d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'inherit','serif'; color: #3d3d3d;"&gt;Both can be manipulated to look at not only the last row loaded but also previously loaded rows.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="margin-bottom: .0001pt; background: #F5FAF0;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Helvetica','sans-serif'; color: #3d3d3d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: #F5FAF0;"&gt;&lt;STRONG style="color: #3d3d3d; font-size: 10.0pt; font-family: 'inherit','serif';"&gt;The Differences&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: #F5FAF0;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Helvetica','sans-serif'; color: #3d3d3d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'inherit','serif'; color: #3d3d3d;"&gt;Previous() operates on the &lt;STRONG&gt;Input&lt;/STRONG&gt; to the Load statement, whereas Peek() operates on the &lt;STRONG&gt;Output&lt;/STRONG&gt; of the Load statement. (Same as the difference between RecNo() and RowNo().) This means that the two functions will behave differently if you have a Where-clause.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="margin-bottom: .0001pt; background: #F5FAF0;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Helvetica','sans-serif'; color: #3d3d3d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'inherit','serif'; color: #3d3d3d;"&gt;The Peek() function can easily reference any previously loaded row in the table using the row number in the function&amp;nbsp; e.g. Peek(‘Employee Count’, 0)&amp;nbsp; loads the first row. Using the minus sign references from the last row up. e.g. Peek(‘Employee Count’, -1)&amp;nbsp; loads the last row. If no row is specified, the last row (-1) is assumed.&amp;nbsp; The Previous() function needs to be nested in order to reference any rows other than the previous row e.g. Previous(Previous(Hires))&amp;nbsp; looks at the second to last row loaded before the current row.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="margin-bottom: .0001pt; background: #F5FAF0;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Helvetica','sans-serif'; color: #3d3d3d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: #F5FAF0;"&gt;&lt;STRONG style="color: #3d3d3d; font-size: 10.0pt; font-family: 'inherit','serif';"&gt;So, when is it best to use each function?&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: #F5FAF0;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Helvetica','sans-serif'; color: #3d3d3d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'inherit','serif'; color: #3d3d3d;"&gt;The previous() and peek() functions could be used when a user needs to show the current value versus the previous value of a field that was loaded from the original file. &lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="margin-bottom: .0001pt; background: #F5FAF0;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Helvetica','sans-serif'; color: #3d3d3d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'inherit','serif'; color: #3d3d3d;"&gt;The peek() function would be better suited when the user is targeting either a field that has not been previously loaded into the table or if the user needs to target a specific row.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 15:25:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Functions/m-p/851246#M993006</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-10T15:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Functions</title>
      <link>https://community.qlik.com/t5/QlikView/Functions/m-p/851247#M993008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;see the attached zipfile for the example &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 15:27:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Functions/m-p/851247#M993008</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-10T15:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Functions</title>
      <link>https://community.qlik.com/t5/QlikView/Functions/m-p/851248#M993010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;does this help you Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 15:37:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Functions/m-p/851248#M993010</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-10T15:37:56Z</dc:date>
    </item>
  </channel>
</rss>

