<?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 Auto-fill backward under conditions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Auto-fill-backward-under-conditions/m-p/1225820#M855688</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have here a script question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/153731_pastedImage_1.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first 3 columns are input values.&lt;/P&gt;&lt;P&gt;Column Gradient needs to be expanded with column Output as results of script calculation.&lt;/P&gt;&lt;P&gt;Column Gradient is based on the sum of Distance, always &amp;lt;= 500 meter.&lt;/P&gt;&lt;P&gt;Let's consider ID = 5. The sum of Distance is equal 350 meter and so all cells DI 1-5 is equal to 12.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now for ID = 17.&lt;/P&gt;&lt;P&gt;Gradient = 20. The sum of Distance for ID = 17, 16, 15, 14, 13 = 476 and agree with the requirement that sum &amp;lt; 500. So, the cells must be filled with 20 for ID = 17, 16, 15, 14, 13.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Table:&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;RowNo&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;() &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, * &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;inline&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[&lt;BR /&gt; Distance, Gradient&lt;BR /&gt; 0 &lt;BR /&gt; 100 &lt;BR /&gt; 201 &lt;BR /&gt; 305 &lt;BR /&gt; 350,12&lt;BR /&gt; 550 &lt;BR /&gt; 600 &lt;BR /&gt; 700,10.5&lt;BR /&gt; 982 &lt;BR /&gt; 1199,15&lt;BR /&gt; 1400 &lt;BR /&gt; 1485 &lt;BR /&gt; 1535 &lt;BR /&gt; 1596 &lt;BR /&gt; 1699&lt;BR /&gt; 1800 &lt;BR /&gt; 2011,20 &lt;BR /&gt; 2239 &lt;BR /&gt; 2399 &lt;BR /&gt; 2600 &lt;BR /&gt; ]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt; &lt;BR /&gt; Table2:&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;NoConcatenate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; *,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;previous&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Gradient&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;gt; 0, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Previous&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Gradient&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Output&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Resident&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; Table &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Order&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;desc&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please provide me the solution? I think you need peek function with Rangesum but I do not know how to solve this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cornelis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator />
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Auto-fill backward under conditions</title>
      <link>https://community.qlik.com/t5/QlikView/Auto-fill-backward-under-conditions/m-p/1225820#M855688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have here a script question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/153731_pastedImage_1.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first 3 columns are input values.&lt;/P&gt;&lt;P&gt;Column Gradient needs to be expanded with column Output as results of script calculation.&lt;/P&gt;&lt;P&gt;Column Gradient is based on the sum of Distance, always &amp;lt;= 500 meter.&lt;/P&gt;&lt;P&gt;Let's consider ID = 5. The sum of Distance is equal 350 meter and so all cells DI 1-5 is equal to 12.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now for ID = 17.&lt;/P&gt;&lt;P&gt;Gradient = 20. The sum of Distance for ID = 17, 16, 15, 14, 13 = 476 and agree with the requirement that sum &amp;lt; 500. So, the cells must be filled with 20 for ID = 17, 16, 15, 14, 13.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Table:&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;RowNo&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;() &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, * &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;inline&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[&lt;BR /&gt; Distance, Gradient&lt;BR /&gt; 0 &lt;BR /&gt; 100 &lt;BR /&gt; 201 &lt;BR /&gt; 305 &lt;BR /&gt; 350,12&lt;BR /&gt; 550 &lt;BR /&gt; 600 &lt;BR /&gt; 700,10.5&lt;BR /&gt; 982 &lt;BR /&gt; 1199,15&lt;BR /&gt; 1400 &lt;BR /&gt; 1485 &lt;BR /&gt; 1535 &lt;BR /&gt; 1596 &lt;BR /&gt; 1699&lt;BR /&gt; 1800 &lt;BR /&gt; 2011,20 &lt;BR /&gt; 2239 &lt;BR /&gt; 2399 &lt;BR /&gt; 2600 &lt;BR /&gt; ]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt; &lt;BR /&gt; Table2:&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;NoConcatenate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; *,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;previous&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Gradient&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;gt; 0, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Previous&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Gradient&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Output&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Resident&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; Table &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Order&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;desc&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please provide me the solution? I think you need peek function with Rangesum but I do not know how to solve this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cornelis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Auto-fill-backward-under-conditions/m-p/1225820#M855688</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Auto-fill backward under conditions</title>
      <link>https://community.qlik.com/t5/QlikView/Auto-fill-backward-under-conditions/m-p/1225821#M855689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one solution might be:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_250529_Pic1.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/153849_QlikCommunity_Thread_250529_Pic1.JPG" style="height: auto; width: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_1487632429404154 jive_text_macro" jivemacro_uid="_1487632429404154"&gt;
&lt;P&gt;Table:&lt;/P&gt;
&lt;P&gt;LOAD RowNo() as ID, * Inline [&lt;/P&gt;
&lt;P&gt;Distance, Gradient&lt;/P&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;P&gt;100&lt;/P&gt;
&lt;P&gt;201&lt;/P&gt;
&lt;P&gt;305&lt;/P&gt;
&lt;P&gt;350,12&lt;/P&gt;
&lt;P&gt;550&lt;/P&gt;
&lt;P&gt;600&lt;/P&gt;
&lt;P&gt;700,10.5&lt;/P&gt;
&lt;P&gt;982&lt;/P&gt;
&lt;P&gt;1199,15&lt;/P&gt;
&lt;P&gt;1400&lt;/P&gt;
&lt;P&gt;1485&lt;/P&gt;
&lt;P&gt;1535&lt;/P&gt;
&lt;P&gt;1596&lt;/P&gt;
&lt;P&gt;1699&lt;/P&gt;
&lt;P&gt;1800&lt;/P&gt;
&lt;P&gt;2011,20&lt;/P&gt;
&lt;P&gt;2239&lt;/P&gt;
&lt;P&gt;2399&lt;/P&gt;
&lt;P&gt;2600&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Join&lt;/P&gt;
&lt;P&gt;LOAD ID,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(IsNum(Gradient),Distance,Peek(LastDistWithGrad)) as LastDistWithGrad,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Alt(Gradient,If(Peek(LastDistWithGrad)-Distance&amp;lt;=500,Peek(Output))) as Output&lt;/P&gt;
&lt;P&gt;Resident Table Order by ID desc;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DROP Field LastDistWithGrad;&lt;/P&gt;
&lt;/PRE&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;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Feb 2017 23:14:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Auto-fill-backward-under-conditions/m-p/1225821#M855689</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2017-02-20T23:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: Auto-fill backward under conditions</title>
      <link>https://community.qlik.com/t5/QlikView/Auto-fill-backward-under-conditions/m-p/1225822#M855690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Marco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is very good. I didn't realize that Alt function is a form of extended IF. A good learning point &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cornelis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Feb 2017 05:34:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Auto-fill-backward-under-conditions/m-p/1225822#M855690</guid>
      <dc:creator />
      <dc:date>2017-02-21T05:34:03Z</dc:date>
    </item>
  </channel>
</rss>

