<?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 Show an interval of rows in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Show-an-interval-of-rows/m-p/1721458#M455563</link>
    <description>&lt;P&gt;Data model has 2 fields, &lt;STRONG&gt;ID&lt;/STRONG&gt; (sequential interger numbers) , and &lt;STRONG&gt;Log&lt;/STRONG&gt; (text)&lt;/P&gt;&lt;P&gt;I have the following problem:&lt;/P&gt;&lt;P&gt;on user selecting a value in field &lt;STRONG&gt;Log&lt;/STRONG&gt; (or multiple values!) show all rows that have these values,&amp;nbsp;&lt;STRONG&gt;as well as the preceding and following 5 lines&lt;/STRONG&gt; (if possible&amp;nbsp; make it so that the user can change 5 to any number he desires)&lt;/P&gt;&lt;P&gt;with some basic set analysis I can get this to work, &lt;STRONG&gt;but only if the selected Log value occurs only once&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Log=, ID = {"&amp;lt;=$(=max(ID+5))&amp;gt;=$(=max(ID-5))"}&amp;gt;} 1)&lt;/P&gt;&lt;P&gt;as soon as the user selection covers more that one row this of course only works for the row with the maximum ID&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/36130i961159D0EA6B54BB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 00:26:15 GMT</pubDate>
    <dc:creator>borisjaksicib</dc:creator>
    <dc:date>2024-11-16T00:26:15Z</dc:date>
    <item>
      <title>Show an interval of rows</title>
      <link>https://community.qlik.com/t5/QlikView/Show-an-interval-of-rows/m-p/1721458#M455563</link>
      <description>&lt;P&gt;Data model has 2 fields, &lt;STRONG&gt;ID&lt;/STRONG&gt; (sequential interger numbers) , and &lt;STRONG&gt;Log&lt;/STRONG&gt; (text)&lt;/P&gt;&lt;P&gt;I have the following problem:&lt;/P&gt;&lt;P&gt;on user selecting a value in field &lt;STRONG&gt;Log&lt;/STRONG&gt; (or multiple values!) show all rows that have these values,&amp;nbsp;&lt;STRONG&gt;as well as the preceding and following 5 lines&lt;/STRONG&gt; (if possible&amp;nbsp; make it so that the user can change 5 to any number he desires)&lt;/P&gt;&lt;P&gt;with some basic set analysis I can get this to work, &lt;STRONG&gt;but only if the selected Log value occurs only once&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Log=, ID = {"&amp;lt;=$(=max(ID+5))&amp;gt;=$(=max(ID-5))"}&amp;gt;} 1)&lt;/P&gt;&lt;P&gt;as soon as the user selection covers more that one row this of course only works for the row with the maximum ID&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/36130i961159D0EA6B54BB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 00:26:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Show-an-interval-of-rows/m-p/1721458#M455563</guid>
      <dc:creator>borisjaksicib</dc:creator>
      <dc:date>2024-11-16T00:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: Show an interval of rows</title>
      <link>https://community.qlik.com/t5/QlikView/Show-an-interval-of-rows/m-p/1721505#M455564</link>
      <description>&lt;P&gt;You have a sample app and the expected output for this?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2020 02:19:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Show-an-interval-of-rows/m-p/1721505#M455564</guid>
      <dc:creator>Arthur_Fong</dc:creator>
      <dc:date>2020-06-24T02:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: Show an interval of rows</title>
      <link>https://community.qlik.com/t5/QlikView/Show-an-interval-of-rows/m-p/1722197#M455565</link>
      <description>&lt;P&gt;I think there are various approaches possible. One could be to chain these ID's with&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/The-As-Of-Table/ba-p/1466130" target="_self"&gt;The-As-Of-Table&lt;/A&gt;. Another might to use an aggr() construct for it. A further possibility would be to use concat() to fetch and combine all wanted ID's - this might be look like:&lt;/P&gt;&lt;P&gt;... ID = {$(='(' &amp;amp; concat(distinct (ID - 1) &amp;amp; '|' &amp;amp; ID &amp;amp; '|' &amp;amp; (ID + 1), '|') &amp;amp; ')')} ...&lt;/P&gt;&lt;P&gt;here just reduced for the readability to +- 1&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2020 14:24:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Show-an-interval-of-rows/m-p/1722197#M455565</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2020-06-25T14:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: Show an interval of rows</title>
      <link>https://community.qlik.com/t5/QlikView/Show-an-interval-of-rows/m-p/1722209#M455566</link>
      <description>&lt;P&gt;Thanks, managed to solve like this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vPrecedingLines&lt;/STRONG&gt; input variable&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vFollowingLines&lt;/STRONG&gt; input variable&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vSelect&amp;nbsp;&lt;/STRONG&gt;is calculated as following:&lt;/P&gt;&lt;P&gt;='{&amp;lt;&lt;STRONG&gt;Log&lt;/STRONG&gt;=, &lt;STRONG&gt;ID&lt;/STRONG&gt;={'&amp;amp;chr(34)&amp;amp;'&amp;gt;='&amp;amp;concat(distinct (&lt;STRONG&gt;ID&lt;/STRONG&gt;-$(&lt;STRONG&gt;vPrecedingLines&lt;/STRONG&gt;))&amp;amp;'&amp;lt;='&amp;amp;(&lt;STRONG&gt;ID&lt;/STRONG&gt;+$(&lt;STRONG&gt;vFollowingLines&lt;/STRONG&gt;)), chr(34)&amp;amp;','&amp;amp;chr(34)&amp;amp;'&amp;gt;=') &amp;amp;chr(34)&amp;amp;'}&amp;gt;}'&lt;/P&gt;&lt;P&gt;and replaces set analysis in the expression&lt;/P&gt;&lt;P&gt;example of output:&lt;/P&gt;&lt;P&gt;{&amp;lt;Log=, ID={"&amp;gt;=36637&amp;lt;=36672","&amp;gt;=557904&amp;lt;=557939","&amp;gt;=70580&amp;lt;=70615"}&amp;gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2020 14:48:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Show-an-interval-of-rows/m-p/1722209#M455566</guid>
      <dc:creator>borisjaksicib</dc:creator>
      <dc:date>2020-06-25T14:48:18Z</dc:date>
    </item>
  </channel>
</rss>

