<?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: Code Understanding in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Code-Understanding/m-p/879669#M999570</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess your main question is about the preceding LOAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;WHILE IterNo() &amp;lt; 3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;This makes the preceding LOAD read each record in the inline loaded table twice, so it will create two records for every original record.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; If(IterNo()= 2,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; If(IsNull(Peek(WaterFallBar,-2)),0,Peek(WaterFallBar,-2)+Peek(Cost,-3)))) AS WaterFallBar,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;The second time a record is read (&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;IterNo()= 2&lt;/SPAN&gt;) it peeks into already loaded rows 2 or 3 rows up and calculates a value&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; If(IterNo() = 1, 'DATA' , 'OFFSET') AS ColorCode,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;the first time a record is read ColorCode is set to DATA, the second time it will be OFFSET&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I think you can work out the others, as they are similar, using IterNo() to see which iteration of the record, and Peek to check values already loaded&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Jun 2015 06:59:36 GMT</pubDate>
    <dc:creator>Ralf-Narfeldt</dc:creator>
    <dc:date>2015-06-12T06:59:36Z</dc:date>
    <item>
      <title>Code Understanding</title>
      <link>https://community.qlik.com/t5/QlikView/Code-Understanding/m-p/879667#M999568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can any one help me understand this code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; RowNo() AS Row,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Process,&lt;/P&gt;&lt;P&gt; If(Process='TOTAL',0,&lt;/P&gt;&lt;P&gt;&amp;nbsp; If(IterNo()= 2,&lt;/P&gt;&lt;P&gt;&amp;nbsp; If(IsNull(Peek(WaterFallBar,-2)),0,Peek(WaterFallBar,-2)+Peek(Cost,-3)))) AS WaterFallBar,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If (Process &amp;lt;&amp;gt; 'TOTAL',If(IterNo()=1,Cost),Peek(WaterFallBar,-2)+Peek(Cost,-3)) AS Cost,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(IterNo() = 1, 'DATA' , 'OFFSET') AS ColorCode,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(IterNo() = 1, 2 , 1 ) AS DimCol WHILE IterNo() &amp;lt; 3;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; *&lt;/P&gt;&lt;P&gt;INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp; Process, Cost&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Code, 6&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Customisations, 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Design, 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Marketing, 4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sales, 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TOTAL, &lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[ColorOffsets]:&lt;/P&gt;&lt;P&gt;LOAD RecNo() AS ColorOffset AUTOGENERATE 1000;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2015 06:36:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Code-Understanding/m-p/879667#M999568</guid>
      <dc:creator>abhaysingh</dc:creator>
      <dc:date>2015-06-12T06:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: Code Understanding</title>
      <link>https://community.qlik.com/t5/QlikView/Code-Understanding/m-p/879668#M999569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abhay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Over here there are few this happening.&lt;/P&gt;&lt;P&gt;1. WaterFallBar: if Process ='TOTAL' it will show 0 and for Next value it will be 0 again and keeps on adding for other values.0,6,9,11 and so on&lt;/P&gt;&lt;P&gt;2.Cost= if Process is not equal to 'Total' it will show its actual cost for all process and for TOTAL you will get the grand total.&lt;/P&gt;&lt;P&gt;3.ColorCode: For first set it will show OFFSET and for other set it will show DATA.&lt;/P&gt;&lt;P&gt;4.DimCol:For first set it will show 1 and for other set it will show 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;KC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2015 06:54:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Code-Understanding/m-p/879668#M999569</guid>
      <dc:creator>jyothish8807</dc:creator>
      <dc:date>2015-06-12T06:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Code Understanding</title>
      <link>https://community.qlik.com/t5/QlikView/Code-Understanding/m-p/879669#M999570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess your main question is about the preceding LOAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;WHILE IterNo() &amp;lt; 3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;This makes the preceding LOAD read each record in the inline loaded table twice, so it will create two records for every original record.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; If(IterNo()= 2,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; If(IsNull(Peek(WaterFallBar,-2)),0,Peek(WaterFallBar,-2)+Peek(Cost,-3)))) AS WaterFallBar,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;The second time a record is read (&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;IterNo()= 2&lt;/SPAN&gt;) it peeks into already loaded rows 2 or 3 rows up and calculates a value&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; If(IterNo() = 1, 'DATA' , 'OFFSET') AS ColorCode,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;the first time a record is read ColorCode is set to DATA, the second time it will be OFFSET&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I think you can work out the others, as they are similar, using IterNo() to see which iteration of the record, and Peek to check values already loaded&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2015 06:59:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Code-Understanding/m-p/879669#M999570</guid>
      <dc:creator>Ralf-Narfeldt</dc:creator>
      <dc:date>2015-06-12T06:59:36Z</dc:date>
    </item>
  </channel>
</rss>

