<?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: Complex script to calculate goods origin in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Complex-script-to-calculate-goods-origin/m-p/119755#M8317</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The maximum number of deliveries for a single product for a single date would be... hundreds.&lt;/P&gt;&lt;P&gt;The maximum number of warehouses which a single product can be taken... maybe ten.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Aug 2018 14:34:23 GMT</pubDate>
    <dc:creator>micheledenardi</dc:creator>
    <dc:date>2018-08-24T14:34:23Z</dc:date>
    <item>
      <title>Complex script to calculate goods origin</title>
      <link>https://community.qlik.com/t5/App-Development/Complex-script-to-calculate-goods-origin/m-p/119749#M8311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0 0 8px; font-size: 14px; color: #444444; font-family: BentonSans, Helvetica, Arial, sans-serif;"&gt;I have to write a script to calculate the &lt;SPAN style="color: #444444; font-family: BentonSans, Helvetica, Arial, sans-serif; font-size: 14px;"&gt;WarehouseNo from which delivered goods are coming from.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 8px; font-size: 14px; color: #444444; font-family: BentonSans, Helvetica, Arial, sans-serif;"&gt;&lt;/P&gt;&lt;P style="margin: 0 0 8px; font-size: 14px; color: #444444; font-family: BentonSans, Helvetica, Arial, sans-serif;"&gt;The data structure is this:&lt;/P&gt;&lt;P style="margin: 0 0 8px; font-size: 14px; color: #444444; font-family: BentonSans, Helvetica, Arial, sans-serif;"&gt;&lt;/P&gt;&lt;P style="margin: 0 0 8px; font-size: 14px; color: #444444; font-family: BentonSans, Helvetica, Arial, sans-serif;"&gt;TabWarehouse:&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="124" style="border: 1px solid rgb(0, 0, 0); width: 211px; height: 106px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;WarehouseNo&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Product&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;QuantityAvailable&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="margin: 0 0 8px; font-size: 14px; color: #444444; font-family: BentonSans, Helvetica, Arial, sans-serif;"&gt;&lt;/P&gt;&lt;P style="margin: 0 0 8px; font-size: 14px; color: #444444; font-family: BentonSans, Helvetica, Arial, sans-serif;"&gt;Delivery:&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="149" style="border: 1px solid rgb(0, 0, 0); width: 137px; height: 101px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Delivery&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Product&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;DlvQuantity&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;300&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="margin: 0 0 8px; font-size: 14px; color: #444444; font-family: BentonSans, Helvetica, Arial, sans-serif;"&gt;&lt;/P&gt;&lt;P style="margin: 0 0 8px; font-size: 14px; color: #444444; font-family: BentonSans, Helvetica, Arial, sans-serif;"&gt;&lt;/P&gt;&lt;P style="margin: 0 0 8px; font-size: 14px; color: #444444; font-family: BentonSans, Helvetica, Arial, sans-serif;"&gt;I don't have a direct link between deliveries and warehouses so i have to calculate a new field in the delivery table where i want to store the WarehouseNo from which delivered goods are coming from.&lt;/P&gt;&lt;P style="margin: 0 0 8px; font-size: 14px; color: #444444; font-family: BentonSans, Helvetica, Arial, sans-serif;"&gt;&lt;/P&gt;&lt;P style="margin: 0 0 8px; font-size: 14px; color: #444444; font-family: BentonSans, Helvetica, Arial, sans-serif;"&gt;For example, if we have 5 deliveries:&lt;/P&gt;&lt;P style="margin: 0 0 8px; font-size: 14px; color: #444444; font-family: BentonSans, Helvetica, Arial, sans-serif;"&gt;- Delivery 1 picks 50pcs from warehouse 1. Now warehouse 1 has only 50pcs available for the next delivery.&lt;/P&gt;&lt;P style="margin: 0 0 8px; font-size: 14px; color: #444444; font-family: BentonSans, Helvetica, Arial, sans-serif;"&gt;- Delivery 2 picks 50pcs from warehouse 1 and 50 from warehouse 2. Now warehouses 1 and 2 are empty.&lt;/P&gt;&lt;P style="margin: 0 0 8px; font-size: 14px; color: #444444; font-family: BentonSans, Helvetica, Arial, sans-serif;"&gt;- Delivery 3 picks 200pcs from warehouse 3. Now warehouse 3 is empty.&lt;/P&gt;&lt;P style="margin: 0 0 8px; font-size: 14px; color: #444444; font-family: BentonSans, Helvetica, Arial, sans-serif;"&gt;- Delivery 4 pick 50pcs from warehouse 4. Now warehouse 4 has 450pcs available &lt;SPAN style="color: #444444; font-family: BentonSans, Helvetica, Arial, sans-serif; font-size: 14px;"&gt;for the next delivery.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 8px; font-size: 14px; color: #444444; font-family: BentonSans, Helvetica, Arial, sans-serif;"&gt;- Delivery 5 picks 300pcs from warehouse 4. &lt;SPAN style="color: #444444; font-family: BentonSans, Helvetica, Arial, sans-serif; font-size: 14px;"&gt;Now warehouse 4 has 150pcs available &lt;/SPAN&gt;&lt;SPAN style="color: #444444; font-family: BentonSans, Helvetica, Arial, sans-serif; font-size: 14px;"&gt;for the next delivery.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 8px; font-size: 14px; color: #444444; font-family: BentonSans, Helvetica, Arial, sans-serif;"&gt;&lt;SPAN style="color: #444444; font-family: BentonSans, Helvetica, Arial, sans-serif; font-size: 14px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 8px; font-size: 14px; color: #444444; font-family: BentonSans, Helvetica, Arial, sans-serif;"&gt;&lt;SPAN style="color: #444444; font-family: BentonSans, Helvetica, Arial, sans-serif; font-size: 14px;"&gt;To obtain this final table&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="149" style="border: 1px solid rgb(0, 0, 0); width: 227px; height: 142px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Delivery&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG style="color: #ffffff; font-size: 13.3333px; text-align: center;"&gt;Product&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG style="color: #ffffff; font-size: 13.3333px; text-align: center;"&gt;DlvQuantity&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;WarehouseNo&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;50&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1 &amp;amp; 2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;200&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;50&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;300&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2018 11:08:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Complex-script-to-calculate-goods-origin/m-p/119749#M8311</guid>
      <dc:creator>micheledenardi</dc:creator>
      <dc:date>2018-08-24T11:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: Complex script to calculate goods origin</title>
      <link>https://community.qlik.com/t5/App-Development/Complex-script-to-calculate-goods-origin/m-p/119750#M8312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think that you have presented a simplified use case - right? How many warehouses would you have per product in your real use case? And how many products? I guess dates would also be involved here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2018 11:42:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Complex-script-to-calculate-goods-origin/m-p/119750#M8312</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2018-08-24T11:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: Complex script to calculate goods origin</title>
      <link>https://community.qlik.com/t5/App-Development/Complex-script-to-calculate-goods-origin/m-p/119751#M8313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, this is very simplified use case.&lt;/P&gt;&lt;P&gt;We have hundeds of warehouses and hundreds of thousands of products.&lt;/P&gt;&lt;P&gt;We can add a delivery date to the delivery so we can establish an order to process it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2018 11:50:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Complex-script-to-calculate-goods-origin/m-p/119751#M8313</guid>
      <dc:creator>micheledenardi</dc:creator>
      <dc:date>2018-08-24T11:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: Complex script to calculate goods origin</title>
      <link>https://community.qlik.com/t5/App-Development/Complex-script-to-calculate-goods-origin/m-p/119752#M8314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good to know - so any proposed approach needs to be scalable to that number of warehouses and products....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2018 12:14:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Complex-script-to-calculate-goods-origin/m-p/119752#M8314</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2018-08-24T12:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: Complex script to calculate goods origin</title>
      <link>https://community.qlik.com/t5/App-Development/Complex-script-to-calculate-goods-origin/m-p/119753#M8315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What would be the maximum number of deliveries for a single product for a single date. How many warehouses would be the maxium number that has to be delivered from?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2018 13:07:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Complex-script-to-calculate-goods-origin/m-p/119753#M8315</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2018-08-24T13:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: Complex script to calculate goods origin</title>
      <link>https://community.qlik.com/t5/App-Development/Complex-script-to-calculate-goods-origin/m-p/119754#M8316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michele de Nardi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I made a start on a script. Too bad I don't have the time to finish it today. Only the 4th iteration is going wrong it still delivers -400 instead of 50. Maybe someone else can work further on my script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this test case it runs fast enough, not quite sure wat the problems will be running hundreds of warehouses and products. Gonna take a lot of time to reload I suppose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe it helps you (or somebody else) to get this difficult task done. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've attached an example. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2018 14:09:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Complex-script-to-calculate-goods-origin/m-p/119754#M8316</guid>
      <dc:creator>avkeep01</dc:creator>
      <dc:date>2018-08-24T14:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: Complex script to calculate goods origin</title>
      <link>https://community.qlik.com/t5/App-Development/Complex-script-to-calculate-goods-origin/m-p/119755#M8317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The maximum number of deliveries for a single product for a single date would be... hundreds.&lt;/P&gt;&lt;P&gt;The maximum number of warehouses which a single product can be taken... maybe ten.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2018 14:34:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Complex-script-to-calculate-goods-origin/m-p/119755#M8317</guid>
      <dc:creator>micheledenardi</dc:creator>
      <dc:date>2018-08-24T14:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: Complex script to calculate goods origin</title>
      <link>https://community.qlik.com/t5/App-Development/Complex-script-to-calculate-goods-origin/m-p/119756#M8318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michele De Nardi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I fixed the script. It runs the deliveries through the warehouses. I added comments in the script to make it better to understand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;basically;&lt;/P&gt;&lt;P&gt;Get the values to be delivered, join them to first warehouse in the sequence. Deliver all possible quantities. That generates a new table with new to deliver quantities and available quantities. This is done in a loop untill all deliveries are fullfilled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE bgcolor="#ffffff" border="1" cellpadding="2" cellspacing="0" style="font-size: 9pt;"&gt;&lt;TBODY&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2018 09:25:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Complex-script-to-calculate-goods-origin/m-p/119756#M8318</guid>
      <dc:creator>avkeep01</dc:creator>
      <dc:date>2018-08-27T09:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: Complex script to calculate goods origin</title>
      <link>https://community.qlik.com/t5/App-Development/Complex-script-to-calculate-goods-origin/m-p/119757#M8319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Small update: when the deliveries can be totally fullfilled an error occures because no new deliveries are calculated. This is fixed in the attached file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2018 10:24:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Complex-script-to-calculate-goods-origin/m-p/119757#M8319</guid>
      <dc:creator>avkeep01</dc:creator>
      <dc:date>2018-08-27T10:24:32Z</dc:date>
    </item>
  </channel>
</rss>

