<?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: Reading the next Sales Order Line Item in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Reading-the-next-Sales-Order-Line-Item/m-p/823152#M1017422</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use the below() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Grtz Fred&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Mar 2015 21:18:47 GMT</pubDate>
    <dc:creator>fred_s</dc:creator>
    <dc:date>2015-03-30T21:18:47Z</dc:date>
    <item>
      <title>Reading the next Sales Order Line Item</title>
      <link>https://community.qlik.com/t5/QlikView/Reading-the-next-Sales-Order-Line-Item/m-p/823151#M1017421</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;In SAP, you have your sales order and sales order line items. In my particular environment, the material # i need to display is always present in the next line item # &lt;EM&gt;after &lt;/EM&gt;the line item # with the material marked specialty stock 'E'. So, i would need to write something like this, I would imagine:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In material # field expression:&lt;/P&gt;&lt;P&gt;if([Spec.Stock] = 'E', &lt;STRONG&gt;return the material # in the next sales order line item #) &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Does anybody know of a QV function or any special code/logic that will read the &lt;EM&gt;next&lt;/EM&gt; value in a field after a given condition?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a ton for your help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2015 21:12:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reading-the-next-Sales-Order-Line-Item/m-p/823151#M1017421</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-30T21:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: Reading the next Sales Order Line Item</title>
      <link>https://community.qlik.com/t5/QlikView/Reading-the-next-Sales-Order-Line-Item/m-p/823152#M1017422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use the below() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Grtz Fred&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2015 21:18:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reading-the-next-Sales-Order-Line-Item/m-p/823152#M1017422</guid>
      <dc:creator>fred_s</dc:creator>
      <dc:date>2015-03-30T21:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: Reading the next Sales Order Line Item</title>
      <link>https://community.qlik.com/t5/QlikView/Reading-the-next-Sales-Order-Line-Item/m-p/823153#M1017423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Fred.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have applied the following expression and am currently getting the material on the first line of the next &lt;EM&gt;sales order &lt;/EM&gt;(I'm looking for the next line item on the same sales order):&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;if(SpecStock = 'E', below(Mat., 1))&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Does anyone have a suggestion for aggregating this to use Line Item as a dimension? i also imagine a pick() might be involved, possibly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Ron&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2015 00:05:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reading-the-next-Sales-Order-Line-Item/m-p/823153#M1017423</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-31T00:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: Reading the next Sales Order Line Item</title>
      <link>https://community.qlik.com/t5/QlikView/Reading-the-next-Sales-Order-Line-Item/m-p/823154#M1017424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ron, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe you should consider to split your table. &lt;/P&gt;&lt;P&gt;Is it possible to show us an example of your data / your tables?&lt;/P&gt;&lt;P&gt;Pref. as attachment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Grtz Fred&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2015 08:05:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reading-the-next-Sales-Order-Line-Item/m-p/823154#M1017424</guid>
      <dc:creator>fred_s</dc:creator>
      <dc:date>2015-03-31T08:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: Reading the next Sales Order Line Item</title>
      <link>https://community.qlik.com/t5/QlikView/Reading-the-next-Sales-Order-Line-Item/m-p/823155#M1017425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fred,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm attaching a qvw. I'll illustrate with a few screenshots (i didn't trim 0's from the data in QV):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Material in Line Item 10 in the below screenshot is marked as Specialty Stock 'E'. Sometimes, another "specialty stock" material can be found on Line Item 33 or so as well. But, the material I am after is on the Line Item number right below the material marked Specialty Stock 'E' 100% of the time. Regardless if 'E' is on line 10 or on line 53, i need the material in the line right below it within the same Sales Order.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/82508_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/82510_pastedImage_1.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the above formula if(SpecStock = 'E', below(Mat., 1)); I have managed to bring the Material in line 10 of the &lt;EM&gt;next&lt;/EM&gt; Sales Order when 'E' is selected. I'm really after the material in the next line item after the material marked Specialty Stock 'E', regardless of user selections. I think there has to be some sort of dimensional selection on line item, but I could be very wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This Specialty Stock can be found on a lot of different line items, so forcing line 11 with set analysis won't help me in this case:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/82511_pastedImage_2.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a ton for your help, as i really can't come up with anything to solve this problem. I'm sure just an expression in the front-end will solve it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Ron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2015 13:58:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reading-the-next-Sales-Order-Line-Item/m-p/823155#M1017425</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-31T13:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Reading the next Sales Order Line Item</title>
      <link>https://community.qlik.com/t5/QlikView/Reading-the-next-Sales-Order-Line-Item/m-p/823156#M1017426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ron, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll look into it, but it may take approx 4 hours.&lt;/P&gt;&lt;P&gt;Have to finish a couple of jobs, drive home (and traffic in windy Netherlands is a bit of a mess at the moment) and having dinner... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Grtz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2015 14:07:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reading-the-next-Sales-Order-Line-Item/m-p/823156#M1017426</guid>
      <dc:creator>fred_s</dc:creator>
      <dc:date>2015-03-31T14:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: Reading the next Sales Order Line Item</title>
      <link>https://community.qlik.com/t5/QlikView/Reading-the-next-Sales-Order-Line-Item/m-p/823157#M1017427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fred,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Be careful in traffic. Please take your time and don't worry about it if you can't get around to it tonight. I just really appreciate your willingness to help me with this issue. If Sales Orders were entered in the system correctly every time, I could just force select line 11 with a simple set analysis. Unfortunately, it can never be that easy with most enterprise data &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/laugh.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Ron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2015 14:23:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reading-the-next-Sales-Order-Line-Item/m-p/823157#M1017427</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-31T14:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: Reading the next Sales Order Line Item</title>
      <link>https://community.qlik.com/t5/QlikView/Reading-the-next-Sales-Order-Line-Item/m-p/823158#M1017428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ron, &lt;/P&gt;&lt;P&gt;Suppose we have excel of this type:- &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 414px;"&gt;&lt;TBODY&gt;&lt;TR style="height: 15.0pt;"&gt;&lt;TD class="xl63" height="20" style="height: 15.0pt; width: 82pt;" width="109"&gt;Store&lt;/TD&gt;&lt;TD class="xl63" style="width: 107pt;" width="142"&gt;&lt;/TD&gt;&lt;TD class="xl63" style="width: 122pt;" width="163"&gt;Sales_Order_Line_Item&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15.0pt;"&gt;&lt;TD class="xl63" height="20" style="height: 15.0pt;"&gt; A&lt;/TD&gt;&lt;TD class="xl63"&gt;&lt;/TD&gt;&lt;TD class="xl63"&gt;Pen&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15.0pt;"&gt;&lt;TD class="xl63" height="20" style="height: 15.0pt;"&gt;B&lt;/TD&gt;&lt;TD class="xl63"&gt;&lt;/TD&gt;&lt;TD class="xl63"&gt;Brush&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15.0pt;"&gt;&lt;TD class="xl63" height="20" style="height: 15.0pt;"&gt;C&lt;/TD&gt;&lt;TD class="xl63"&gt;&lt;/TD&gt;&lt;TD class="xl63"&gt;Car&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15.0pt;"&gt;&lt;TD class="xl63" height="20" style="height: 15.0pt;"&gt;E&lt;/TD&gt;&lt;TD class="xl63"&gt;&lt;/TD&gt;&lt;TD class="xl63"&gt;Pencil&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15.0pt;"&gt;&lt;TD class="xl63" height="20" style="height: 15.0pt;"&gt;D&lt;/TD&gt;&lt;TD class="xl63"&gt;&lt;/TD&gt;&lt;TD class="xl63"&gt;Book&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15.0pt;"&gt;&lt;TD class="xl63" height="20" style="height: 15.0pt;"&gt;F&lt;/TD&gt;&lt;TD class="xl63"&gt;&lt;/TD&gt;&lt;TD class="xl63"&gt;Cap&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Now suppose we have to create a table such that if Store=E then pick the next Sales_Order_Line_Item which is Book otherwise pick the same &lt;SPAN style="font-size: 13.3333330154419px;"&gt;Sales_Order_Line_Item. Resultant table will look like:-&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Store&lt;/TD&gt;&lt;TD&gt;Sales_Order_Line_Item&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt; A&lt;/TD&gt;&lt;TD&gt;Pen&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;Brush&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;Car&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;TD&gt;Book&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;TD&gt;Book&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;F&lt;/TD&gt;&lt;TD&gt;Cap&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Required Code is:-&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD Store, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sales_Order_Line_Item&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;Count(Store) as Count &lt;/P&gt;&lt;P&gt;Resident Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vTest = Peek('Count',0,'Count');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i=1 to $(vTest)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data1:&lt;/P&gt;&lt;P&gt;load &lt;/P&gt;&lt;P&gt;peek('Store',$(i)-1,'Data') as Store,&lt;/P&gt;&lt;P&gt;if ( peek('Store',$(i)-1,'Data')='E',peek('Sales_Order_Line_Item',$(i),'Data'),peek('Sales_Order_Line_Item',$(i)-1,'Data')) as [Sales Order Line Item1] &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AutoGenerate 1;&lt;/P&gt;&lt;P&gt;next;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please revert if there are any challenges.&lt;/P&gt;&lt;P&gt;Thanks and Regards&lt;/P&gt;&lt;P&gt;Jasmeet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2015 19:10:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reading-the-next-Sales-Order-Line-Item/m-p/823158#M1017428</guid>
      <dc:creator />
      <dc:date>2015-03-31T19:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Reading the next Sales Order Line Item</title>
      <link>https://community.qlik.com/t5/QlikView/Reading-the-next-Sales-Order-Line-Item/m-p/823159#M1017429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ron, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached a Qlikview file with Materials created in the script, using the Previous() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Grtz Fred&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 19:42:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reading-the-next-Sales-Order-Line-Item/m-p/823159#M1017429</guid>
      <dc:creator>fred_s</dc:creator>
      <dc:date>2015-04-01T19:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: Reading the next Sales Order Line Item</title>
      <link>https://community.qlik.com/t5/QlikView/Reading-the-next-Sales-Order-Line-Item/m-p/823160#M1017430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a whole lot, Fred. Above(), Below(), and Previous() are new ideas to me. I'll try to look up some more examples and learn these function's behavior. This solution works great. Thanks again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Ron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2015 13:46:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reading-the-next-Sales-Order-Line-Item/m-p/823160#M1017430</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-03T13:46:12Z</dc:date>
    </item>
  </channel>
</rss>

