<?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: Loop in a script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Loop-in-a-script/m-p/2445615#M1225655</link>
    <description>&lt;P&gt;exactly what I wanted and so an easy way to solve the problem, thanks&amp;nbsp;&lt;A id="link_9" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22593" target="_self" aria-label="View Profile of rubenmarin" aria-describedby="userProfileCard-22593"&gt;&lt;SPAN class="login-bold"&gt;Rubenmarin&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 27 Apr 2024 19:33:54 GMT</pubDate>
    <dc:creator>JR_38</dc:creator>
    <dc:date>2024-04-27T19:33:54Z</dc:date>
    <item>
      <title>Loop in a script</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-in-a-script/m-p/2445357#M1225651</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;i would need your help on this topic:&lt;/P&gt;
&lt;P&gt;I am getting following Data under Qlikview:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JR_38_0-1714144495534.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/164807i9E5B20D45E42B171/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JR_38_0-1714144495534.png" alt="JR_38_0-1714144495534.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I would like to assign the field-information from "AREA-EAN" when the Datatyp='AREA'&amp;nbsp; as own column for the following eans, and then remove the line related to the datatyp "AREA" .&lt;/P&gt;
&lt;P&gt;It should look like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JR_38_1-1714145212860.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/164808iFADF69715EF0E04B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JR_38_1-1714145212860.png" alt="JR_38_1-1714145212860.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I set different variables in order to use it in my first loop but the for...next doens´t work.&lt;/P&gt;
&lt;DIV&gt;INV_RAWDATA:&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;LOAD * INLINE [&lt;/DIV&gt;
&lt;DIV&gt;ID, Datatyp, AREA_EAN, Qty&lt;/DIV&gt;
&lt;DIV&gt;1, AREA, A-30-D-00, 1&lt;/DIV&gt;
&lt;DIV&gt;2, EANS, 4062171924956, 2&lt;/DIV&gt;
&lt;DIV&gt;3, EANS, 4062171874947, 2&lt;/DIV&gt;
&lt;DIV&gt;4, EANS, 4062171912946, 1&lt;/DIV&gt;
&lt;DIV&gt;5, EANS, 4062171924956, 1&lt;/DIV&gt;
&lt;DIV&gt;6, EANS, 4062171924956, 1&lt;/DIV&gt;
&lt;DIV&gt;7, AREA, A-29-D-00, 1&lt;/DIV&gt;
&lt;DIV&gt;8, EANS, 4062171874930, 1&lt;/DIV&gt;
&lt;DIV&gt;9, EANS, 4062171912946, 1&lt;/DIV&gt;
&lt;DIV&gt;10, EANS, 4066952504313, 1&lt;/DIV&gt;
&lt;DIV&gt;11, EANS, 4066952504320, 1&lt;/DIV&gt;
&lt;DIV&gt;12, EANS, 4066952504320, 1&lt;/DIV&gt;
&lt;DIV&gt;13, EANS, 4066952504320, 1&lt;/DIV&gt;
&lt;DIV&gt;];&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Store INV_RAWDATA into File.qvd;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;// set Variable with information&lt;/DIV&gt;
&lt;DIV&gt;VARIABLE_I:&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;set i=1;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;LOAD ID,&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;AREA_EAN,&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Datatyp,&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Qty&lt;/DIV&gt;
&lt;DIV&gt;FROM File.qvd (qvd) where ID=$(i) and Datatyp='AREA';&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;let i=$(i)+1;&lt;/DIV&gt;
&lt;DIV&gt;let AREA=peek('AREA_EAN',0,'VARIABLE_I');&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;VARIABLE_II:&lt;/DIV&gt;
&lt;DIV&gt;LOAD&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; max(ID) as max_i&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;FROM&lt;/DIV&gt;
&lt;DIV&gt;File.qvd (qvd);&lt;/DIV&gt;
&lt;DIV&gt;let max_i=peek('max_i',0,'VARIABLE_II');&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;//&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;FOR i=$(i) to max_i=$(max_i)&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;RUN:&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;LOAD&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; '$(AREA)' as AREA,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; ID,&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;AREA_EAN,&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Datatyp,&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Qry&lt;/DIV&gt;
&lt;DIV&gt;FROM&lt;/DIV&gt;
&lt;DIV&gt;File.qvd (qvd) ;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;NEXT&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Has somebody any idea how I could get the desired result?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2024 15:57:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-in-a-script/m-p/2445357#M1225651</guid>
      <dc:creator>JR_38</dc:creator>
      <dc:date>2024-04-26T15:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: Loop in a script</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-in-a-script/m-p/2445474#M1225653</link>
      <description>&lt;P&gt;Hello, this script gets the result table:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;OrigData:
LOAD * INLINE [
ID, Datatyp, AREA_EAN, Qty
1, AREA, A-30-D-00, 1
2, EANS, 4062171924956, 2
3, EANS, 4062171874947, 2
4, EANS, 4062171912946, 1
5, EANS, 4062171924956, 1
6, EANS, 4062171924956, 1
7, AREA, A-29-D-00, 1
8, EANS, 4062171874930, 1
9, EANS, 4062171912946, 1
10, EANS, 4066952504313, 1
11, EANS, 4066952504320, 1
12, EANS, 4066952504320, 1
13, EANS, 4066952504320, 1
];
 
ProcessData:
NoConcatenate LOAD
	ID,
	Datatyp,
	If(Datatyp='EANS', Peek(AREA_EAN), AREA_EAN) as AREA_EAN,
	Qty
Resident OrigData;

DROP Table OrigData;

FinalData:
NoConcatenate LOAD * Resident ProcessData where Datatyp='EANS';

DROP Table ProcessData;&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 27 Apr 2024 06:42:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-in-a-script/m-p/2445474#M1225653</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2024-04-27T06:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: Loop in a script</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-in-a-script/m-p/2445615#M1225655</link>
      <description>&lt;P&gt;exactly what I wanted and so an easy way to solve the problem, thanks&amp;nbsp;&lt;A id="link_9" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22593" target="_self" aria-label="View Profile of rubenmarin" aria-describedby="userProfileCard-22593"&gt;&lt;SPAN class="login-bold"&gt;Rubenmarin&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Apr 2024 19:33:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-in-a-script/m-p/2445615#M1225655</guid>
      <dc:creator>JR_38</dc:creator>
      <dc:date>2024-04-27T19:33:54Z</dc:date>
    </item>
  </channel>
</rss>

