monday function also works on week formats. Output will be the Monday date of the week in input.
E.g: monday(week(2025,04)) is Jan 20th 2025.
Code example: https://try.lokad.com/s/monday_week
monday function also works on a weeks. The output is the Monday's da
Update : rankrev will be deprecated long term.
Best practice is to use rank() scan [T.N desc]
Using keyword desc enables using any sortable type while a minus sign would not.
One should not have /.navlogo.png in the root folder of the account but in "/static/navlogo.png"
7. CHINA AND CAMBODIA SEAL 1.16 BILLION USD CANAL DEAL
Beijing and Phnom Penh finalised a 1.16 billion USD public‑private agreement to build the 151.6 km Funan Techo Canal, giving Cambodia a direct route from the Mekong River to the Gulf of Thailand. With Chinese firms holding 49 % of the project, the canal could reroute regional trade and reduce reliance on Vietnam’s port network—though environmental groups warn of risks to downstream rice production.
Sources:
https://apnews.com/article/c471352392844998057c24752ba6d4fa
https://www.reuters.com/world/asia-pacific/cambodia-eyes-more-china-help-xi-visits-amid-us-tariff-tensions-2025-04-17
8. ARAMEX TURNS TO AI VIA SHIPSY PARTNERSHIP
Middle‑East logistics provider Aramex signed a master services agreement with Indian SaaS firm Shipsy to embed AI‑driven route optimisation, courier planning, and real‑time delay prediction across its network. The tie‑up underpins Aramex’s rollout of same‑day delivery in key markets and reflects a broader trend of carriers investing in software to squeeze more productivity from last‑mile fleets.
Sources:
https://www.prnewswire.com/in/news-releases/aramex-partners-with-shipsy-to-enhance-last-mile-efficiency-and-productivity-using-ai-302427507.html
https://www.businesstoday.in/technology/news/story/aramex-taps-shipsys-ai-to-turbocharge-last-mile-delivery-and-launch-same-day-shipping-471915-2025-04-14
9. XPENG REVIEWS SUPPLY CHAIN TO WEATHER TARIFF TURBULENCE
Chinese EV maker Xpeng completed a “thorough analysis” of its supplier base to safeguard production from escalating US‑China tariffs. Executives said current sales remain unaffected but acknowledged the need for contingency sourcing and buffer inventories as geopolitical risks rise—echoing similar resilience moves by tech and auto peers exporting to Europe and North America.
Sources:
https://www.reuters.com/business/autos-transportation/chinas-xpeng-says-it-reviewed-supply-chain-insulate-it-tariff-turmoil-2025-04-16
https://ca.finance.yahoo.com/news/chinas-xpeng-says-reviewed-supply-023314779.html
10. PROLOGIS SEES STOCKPILING DEMAND BUT FLAGS WIDER UNCERTAINTY
Warehouse‑owner Prologis kept its 2025 earnings guidance but noted that customers are “more cautious,” pulling forward inventory to hedge against tariff shocks. Occupancy dipped to just under 95 %, yet executives believe a “disconnected world” will ultimately require extra logistics real estate as firms localise supply chains—hinting at longer‑term demand despite near‑term volatility.
Sources:
https://www.freightwaves.com/news/prologis-sticks-with-2025-outlook-as-customers-get-more-cautious
https://finance.yahoo.com/news/prologis-sticks-2025-outlook-customers-182932473.html
4. DHL SUSPENDS E‑COMMERCE SHIPMENTS OVER 800 USD TO THE US
Effective 21 April, DHL Express halted business‑to‑consumer parcels valued above 800 USD bound for US addresses. The carrier cites a sudden surge in formal customs‑entry filings after US Customs lowered the informal threshold to 800 USD (from 2 500 USD) on 5 April. Until DHL scales up brokerage capacity, high‑value cross‑border orders will be delayed or rerouted—an immediate headache for marketplaces and luxury brands that rely on express delivery.
Sources:
https://www.theverge.com/news/652977/dhl-shipment-delays-us-tariffs-business-to-consumer
https://www.dhl.com/us-en/home/important-information/2025/shipments-to-the-united-states-with-a-customs-value-exceeding-usd-800.html
5. DE MINIMIS LOOPHOLE CLOSES FOR CHINA AND HONG KONG PARCELS
From 2 May, all low‑value parcels under 800 USD arriving from China or Hong Kong will lose duty‑free status and face either a 145 % ad‑valorem tariff or a flat fee starting at 100 USD (rising to 200 USD on 1 June). Analysts project the rule could strip 22 billion USD in revenue from trans‑Pacific air‑cargo lanes over three years and force platforms like Shein and Temu to raise US prices.
Sources:
https://www.investopedia.com/de-minimis-exemption-rule-11715853
https://www.whitehouse.gov/fact-sheets/2025/04/fact-sheet-president-donald-j-trump-closes-de-minimis-exemptions-to-combat-chinas-role-in-americas-synthetic-opioid-crisis
6. MISUMI BUYS FICTIV FOR 350 MILLION USD IN DIGITAL MANUFACTURING PUSH
Japanese components giant Misumi Group announced an all‑cash acquisition of San Francisco‑based Fictiv for 350 million USD. Fictiv’s cloud platform uses artificial intelligence to match engineers with a vetted network of 250 + fabrication partners. Integrating the software aims to shorten prototype lead times and give Misumi customers on‑demand access to global capacity—another sign of heavy investment in supply‑chain software.
Sources:
https://www.freightwaves.com/news/fictiv-acquired-for-350m-by-japanese-components-supplier
https://www.therobotreport.com/misumi-acquires-fictiv-for-350m-to-scale-component-offerings
10. VOLVO & GREENLANE PARTNER ON EV TRUCK CHARGING:
In a boost for transportation electrification, charging network operator Greenlane is teaming up with Volvo to integrate Greenlane’s public high-power chargers into the Volvo Open Charge platform for electric trucks. This partnership will let fleet drivers easily locate and access Greenlane’s North American charging sites through Volvo’s system, providing seamless charging for heavy-duty electric vehicles of any brand along key freight routes. By improving infrastructure and user experience for electric truck fleets, the collaboration addresses a critical link in the sustainable supply chain transition – helping to reduce emissions in freight transportation while making EV adoption more practical for logistics operators.
Sources:
https://www.drivegreenlane.com/news/greenlane-and-volvo-partner-to-drive-commercial-electrification/
https://www.drivegreenlane.com/news/greenlane-and-volvo-partner-to-drive-commercial-electrification/
7. ROBOTICS SHINE AT PROMAT TO TACKLE WAREHOUSE LABOR CRUNCH:
The ProMat 2025 expo in Chicago showcased the latest warehouse and supply chain technologies, with a heavy emphasis on robotics to address the ongoing labor shortage in logistics. Vendors demonstrated advanced automated solutions – from dense storage retrieval systems and autonomous mobile robots (AMRs) to aerial inventory drones and AI-driven picking arms – all aimed at boosting efficiency and reducing reliance on scarce human labor. The proliferation of these innovations, by companies like Quicktron, XYZ Robotics, and Universal Robots, underscores an industry push toward automation to enhance productivity and supply chain resilience in fulfillment operations.
Sources:
https://logisticsviewpoints.com/2025/04/11/supply-chain-logistics-news-april-7th-10th-2025/
https://logisticsviewpoints.com/2025/04/11/supply-chain-logistics-news-april-7th-10th-2025/
8. WAREHOUSE AUTOMATION: GAP AND GNC EMBRACE ROBOTS & DRONES:
Retailers are deploying new technologies in distribution centers to improve safety and accuracy. Gap Inc. has started using Boston Dynamics’ “Stretch” robots to unload merchandise from trailers at several U.S. distribution centers, augmenting workers and significantly reducing on-the-job injuries while speeding up inbound throughput. Meanwhile, health retailer GNC implemented autonomous drones (Corvus One) for daily inventory cycle counts in its warehouses, which has improved inventory accuracy and freed up staff and equipment for order fulfillment, resulting in faster operations and fewer errors. These real-world deployments illustrate how robotics and drones are transforming warehousing by taking on tedious or strenuous tasks – improving efficiency and worker well-being in the process.
Sources:
https://www.bringoz.com/bringoz-industry-weekly-4-6/
https://blog.adafruit.com/2025/04/07/gnc-now-using-drones-for-inventory-management-drone-droneday/
9. SUPPLY CHAIN SOFTWARE STARTUP RAISES 40 MILLION USD:
In supply chain tech investment news, Ann Arbor-based Optilogic closed a 40 million USD Series B funding round to accelerate development of its cloud-native supply chain optimization and decision-making platform. Optilogic’s software leverages data integration and AI-driven analytics to let companies model scenarios and design more resilient, cost-effective supply chains. The funding – led by supply chain-focused investors – highlights continued momentum in the digital supply chain arena, as enterprises seek more sophisticated tools to navigate complexity and disruptions in global logistics.
Sources:
https://optilogic.com/resources/news/optilogic-closes-40-million-series-b-funding/
https://optilogic.com/resources/news/optilogic-closes-40-million-series-b-funding/
4. AMAZON LAUNCHES LTL FREIGHT SERVICE:
E-commerce giant Amazon rolled out a new less-than-truckload (LTL) shipping service for vendors sending goods to its fulfillment centers. Through Amazon’s self-service freight portal, shippers can now get instant quotes, compare LTL vs. full-truckload options, and book inbound loads up to 14 days in advance. Backed by Amazon’s network of 60,000 trailers, the service (initially for U.S. domestic inbound freight) extends Amazon’s logistics capabilities into LTL transport, offering seamless tracking, online billing, and potentially more competitive rates for suppliers – and signaling Amazon’s continued expansion into every segment of the supply chain.
Sources:
https://www.supplychaindive.com/news/amazon-offers-ltl-services/745160/
https://www.supplychaindive.com/news/amazon-offers-ltl-services/745160/
5. NOVARTIS INVESTING 23 BILLION USD IN U.S. MANUFACTURING:
Swiss pharmaceutical leader Novartis announced plans to spend 23 billion USD over five years to build six new production plants and expand three others in the United States. This massive investment will enable Novartis to produce all key medicines “end to end” domestically for the U.S. market. Coming amid tariff turmoil and geopolitical supply risks, the move follows similar localization pushes by peers and reflects a broader trend of strengthening domestic manufacturing capacity to enhance supply chain resilience for critical products.
Sources:
https://www.supplychaindive.com/news/novartis-23-billion-us-manufacturing-new-drug-plants/745100/
https://www.supplychaindive.com/news/novartis-23-billion-us-manufacturing-new-drug-plants/745100/
6. UNILEVER ACQUIRES ECO-FRIENDLY BRAND WILD:
Consumer goods giant Unilever bolstered its sustainable product portfolio by acquiring Wild, a UK-based startup known for natural, refillable personal care products. Wild – launched in 2020 – sells refillable deodorants, lip balms, body washes and more, with a mission to eliminate single-use plastics in bathrooms. The acquisition aligns with Unilever’s Growth Action Plan 2030 focus on high-growth, planet-friendly brands, and demonstrates the growing demand for sustainable packaging solutions in the supply chain as consumers and regulators increasingly push to reduce plastic waste.
Sources:
https://www.cosmeticsdesign-europe.com/Article/2025/04/01/unilever-acquires-eco-friendly-brand-wild/
https://www.cosmeticsdesign-europe.com/Article/2025/04/01/unilever-acquires-eco-friendly-brand-wild/
slicetree performance is awful is you have many slices in the terminal leaf of the tree - if you want to display "slices like the top right slicer" but not at the top right position, you should consider slicepicker instead.
9. MARCH 31, 2025 – AIRBUS SAYS SUPPLY CHAIN WOES ARE EASING:
A senior executive at AIRBUS reported that while aircraft production is still constrained by parts shortages (especially jet engines), the situation is "GETTING BETTER" and more manageable. Benoît de Saint-Exupéry, Airbus EVP of sales, said the company has learned from the pandemic and is now handling supplier disruptions with much more foresight. Airbus delivered 766 jets last year despite these hurdles and just signed a new A350 deal with Taiwan’s China Airlines. The outlook: supply chain recovery will take time but is steadily improving, with persistent bottlenecks (engines) being addressed through closer coordination and anticipation.
10. MARCH 31, 2025 – NUCLEAR REACTOR FIRMS RACE TO SECURE FUEL SUPPLY:
Developers of SMALL MODULAR REACTORS (SMRS) are investing in a new nuclear fuel supply chain to support next-generation reactors. Recent deals and initiatives aim to ensure adequate production of HALEU FUEL (HIGH-ASSAY LOW-ENRICHED URANIUM), amid fears that lack of fuel could delay the roll-out of SMRS. Companies like TERRAPOWER, X-ENERGY, OKLO, and others have to "BUILD OUT THE SUPPLY CHAIN IN REVERSE" – securing fuel before reactors come to market. The U.S. Department of Energy estimates demand for HALEU could reach 50 tons per year by 2035, but current domestic output is only a fraction of that. (The sole global supplier, Russia, is now off-limits due to import bans.) This scramble highlights a critical ENERGY SUPPLY CHAIN gap that industry and government are urgently trying to fill.
Sources:
https://www.reuters.com/business/energy/smr-firms-race-build-nuclear-fuel-supply-chain-2025-03-31/
5. MARCH 31, 2025 – DHL BUYS CRYOPDP TO BOOST PHARMA LOGISTICS:
DHL Group announced it will acquire CRYOPDP – a specialty courier for clinical trials and biotech shipments – from Cryoport, Inc. The move expands DHL’s Life Sciences & Healthcare logistics portfolio. DHL is taking 100% ownership of CRYOPDP, which operates in 15 countries, to enhance its capabilities in temperature-controlled pharma supply chains. As part of the deal, DHL and Cryoport are forming a strategic partnership to strengthen end-to-end supply chain services for the global pharma and biotech sector.
6. APRIL 3, 2025 – VW & MAERSK USE CONTAINERS TO SOLVE AUTO LOGJAM:
An innovative logistics solution emerged in Mexico as VOLKSWAGEN and MAERSK deployed a "CARS IN CONTAINERS" program to bypass rail bottlenecks. Faced with a capacity shortfall in rail transport, VW began shipping finished vehicles in standard shipping containers, a radical shift from traditional rail or roll-on/roll-off methods. This approach cleared a backlog of over 8,000 cars and slashed vehicle damage rates to near zero, proving to be a game-changer for VW Mexico’s export supply chain. The success has VW and Maersk planning to expand the containerized car strategy (even integrating air freight for more flexibility) going forward.
Sources:
https://www.maersk.com/news/articles/2024/12/20/volkswagen-mexicos-vehicle-export
7. APRIL 1, 2025 – 400 MILLION USD INVESTMENT IN WAREHOUSE ROBOTS:
AGILITY ROBOTICS, an Oregon-based maker of humanoid warehouse robots ("Digit"), is reportedly raising 400 million USD in new funding. The round, led by WP Global’s venture arm with participation from SoftBank, would value the robotics startup at 1.75 billion USD. Agility’s bipedal robots are already tested in Amazon warehouses, and this massive investment underscores the booming interest in AI-driven warehouse automation and labor augmentation in supply chains.
8. MARCH 31, 2025 – RETAILER SEES TARIFFS AS A SUPPLY CHAIN OPPORTUNITY:
WILLIAMS-SONOMA CEO LAURA ALBER struck an optimistic tone on U.S. tariffs, suggesting they present an "OPPORTUNITY" to widen product margins. Because the home-goods retailer designs most of its own products, it has pricing power and unique merchandise that competitors can’t easily undercut. Alber noted Williams-Sonoma’s long-term strategy of diversifying sourcing away from China has positioned it to avoid the worst tariff impacts. By moving production to lower-cost, "un‑tariffed" regions and leveraging strong vendor relationships, the company aims to outmaneuver rivals and even benefit from the new trade barriers.
Sources:
https://www.supplychaindive.com/news/williams-sonoma-leverage-tariffs-china-pricing/743756/
10. SUPPLY CHAINS EMBRACE AI – WITH MIXED RESULTS
A new Gartner survey found 72% of supply chain organizations are deploying generative AI tools, but many report only middling productivity gains so far. Supply chain leaders remain optimistic about AI-driven forecasting and decision support, yet challenges around data quality and integration persist. The rise of AI, including digital twin simulations and intelligent agents, is a top 2025 trend as companies pilot solutions to boost agility despite some early-stage hurdles in ROI.
11. INFOR & KINAXIS PARTNER ON PLANNING SOLUTION
Infor, a cloud ERP provider, teamed up with supply chain software firm Kinaxis to launch a joint planning platform for mid-sized manufacturers. The new product, Kinaxis Planning One for Infor CloudSuite, integrates Kinaxis’s rapid planning and scenario simulation capabilities with Infor’s ERP suites for discrete manufacturing. This collaboration aims to give industrial firms better end-to-end visibility, aligning production plans with supply chain realities in one unified system to improve responsiveness and efficiency.
12. AMERICAN AIRLINES ADOPTS IOT FOR CARGO TRACKING
American Airlines signed a contract with Unilode to upgrade its entire ULD fleet with Bluetooth and LoRa sensors for real-time tracking. Starting later this year, the carrier will deploy these smart containers and pallets along with Unilode’s cloud platform to monitor cargo location and conditions. This digital initiative is expected to reduce lost equipment and improve cargo handling efficiency, as part of the airline’s broader push toward data-driven operations.
Sources:
https://www.aircargonews.net/ulds/american-airlines-selects-unilode-for-uld-services/1079825.article
6. DESCARTES ACQUIRES 3GTMS TMS SOFTWARE
Canada-based Descartes Systems Group acquired 3GTMS, a U.S. transportation management system provider, for about $115 million. The deal, Descartes’ 32nd acquisition since 2016, strengthens its TMS capabilities for shippers and 3PLs. This consolidation reflects ongoing investment in logistics software platforms to improve freight planning and execution.
7. $1B LOGISTICS TECH VENTURE FUND LAUNCHED
Silicon Valley VC firm 8VC closed a new $998 million fund dedicated to supply chain and logistics technology. The firm’s sixth flagship fund will back “transformative technologies” in areas like end-to-end supply chain visibility software, last-mile delivery optimization, warehouse automation, and freight innovation. The hefty fundraise highlights investor confidence in logistics tech, following a surge of startups tackling industry challenges accelerated by digitization.
Sources:
https://www.ainvest.com/news/8vc-raises-998m-reshape-logistics-landscape-2503/
8. SHIPPING ALLIANCE PUSHES DIGITAL DOCUMENTATION
The Digital Container Shipping Association (DCSA) released final e-document standards, Booking 2.0 and Bill of Lading 3.0, to streamline ocean freight processes. The enhanced eBL standard now supports digital signatures and over 190 data attributes to meet new EU customs requirements. By standardizing data and boosting security, carriers and forwarders aim to cut paperwork and improve efficiency in global trade.
Sources:
https://splash247.com/digital-container-shipping-association-unveils-latest-upgrades/
9. “SMART CONTAINER ALLIANCE” LAUNCHED FOR IOT TRACKING
Major ocean carriers and tech firms formed the Smart Container Alliance to accelerate adoption of IoT-enabled shipping containers. This new coalition seeks to standardize smart container technology for real-time cargo tracking and condition monitoring. By uniting shipping lines, customs authorities, and tech providers, the alliance plans to combat illicit trade and cargo theft while improving supply chain visibility and efficiency through connected containers.
Sources:
https://splash247.com/smart-container-alliance-launches/
It's also not perfectly clear but a pattern like
/output/myfile_*.csv
is also valid.
You can also use over to do rolling aggregation on another table than Day.
Ex: Month.NetAmountLast2Y= sum(Month.NetAmount) over month = [-23..0]
To create a new connection/auth script: https://go.lokad.com/AccountTrigram/sync/connection/
To create a new transfert script: https://go.lokad.com/AccountTrigram/sync/transfer/ or from the connection script UI.
You may have to click Edit on existant transfers / connections to see details such as the instructions.
In the title, we have "forex(origin: text, destination: text) 🡒 date, pure function" instead of "lastForex(origin: text, destination: text) 🡒 date, pure function"
Thank you for the response, Conor and Joannes!
Asked Lokad AI:
The name Lokad is a portmanteau of two words: "local" and "cadence." It reflects the company's focus on the local optimization of supply chain decisions, which is achieved through the application of probabilistic forecasting and economic modeling. The term "cadence" refers to the rhythm or timing of supply chain events, which is a critical aspect of supply chain management. Lokad's approach emphasizes the importance of making decisions that are economically sound and that take into account the specificities of each local situation within a supply chain network. This approach contrasts with traditional methods that often rely on simplistic heuristics and do not fully consider the economic implications of supply chain decisions.
Correct? Thank you! Happy New Year
Could you share a link to find the correct date format?
Different results are to be expected between truncate(r,a,b) and max(a,min(b,r))
The former will redistribute the truncated odds between bins in [a,b]
The latter will accumulate the odds of being lesser than a to a and those of being greater than b to b
Ex:
r = uniform(9)
r_trunc = truncate(r, 1,5) || r_minmax = max(1,min(5,r))
P(r_trunc=4) = 0.2 = P(r=4)/P(r not in [1,5]) || P(r_minmax=4) = 0.1 = P(r=4)
P(r_trunc=5) = 0.2 = P(r=1)/P(r not in [1,5]) || P(r_minmax=5) = 0.5 = P(r>=5)
Lokad has its own stochastic optimization tools, comparable to Seeker from InsideOpt. Those tools are not yet publicly documented.
Those tools are using the stochastic gradient descent (SGD), but it's only a small piece of the puzzle. There are two main challenges. First, SGD only works on continuous spaces, but the supply chain problems are invariably discrete. Second, a "naive" gradient descent fails at handling any non-convex situation. Our tools addresses both challenges.
The central insight of those tools is to put a learning process at the core of the optimization process. Lokad is not the only company doing that. AlphaFold from DeepMind is also doing that for another optimization problem, aka protein folding.
The reason why SGD is very important is that it gives a direction to the descent. Yes, the pure descent is insufficient (aka second challenge above), but ignoring altogether the most likely direction of the descent is highly inefficient. Moreover, SGD is remarkably scalable.
My former research supervisor, Mehryar Mohri, at the AT&T Labs was of the opinion that having "metaheuristic algorithms" was akin to saying you have no algorithm. Two decades later, this statement is still remarkably accurate. This class of techniques is only marginally better than random exploration.
My 2cts on the case. Hope it helps.
Hi Joshua! Thanks for the question. I'll ping an internal expert to answer your question.
It should be great to add a quick example.
show chart "Test" with
plot by [T.X] slices:slice
same(T.Y)
The comment in the code
table Ranges = with
[| date(2010, 01, 03) as Start, date(2010, 10, 12) as End |]
[| date(2011, 07, 23) , date(2012, 03, 01) |]
[| date(2010, 09, 27) , date(2011, 05, 31) |]
Ranges.Collision = for Start in Ranges.Start,
End in Ranges.End
// (true, false, false) on the 1st iteration,
// (false, true, false) on the 2nd,
// (false, false, true) on the 3rd
Ranges.NotSameRange = (Start != Ranges.Start or End != Ranges.End)
// (true, false, true) on the 1st iteration,
// (false, true, false) on the 2nd iteration,
// (true, false, true) on the 3rd iteration
Ranges.Intersects = max(Start, Ranges.Start) <= min(End, Ranges.End)
// true on the 1st iteration,
// false on the 2nd iteration,
// true on the 3rd iteration
return any(Ranges.NotSameRange and Ranges.Intersects)
show table "Ranges" with
Ranges.Start
Ranges.End
Ranges.Collision // (true, false, true)
should be
// (false, true, true) on the 1st iteration,
// (true, false, true) on the 2nd,
// (true, true, false) on the 3rd
Ranges.NotSameRange = (Start != Ranges.Start or End != Ranges.End)
table Sizes[size] = with
[| as size, as Weight |]
[| "S", 0.5 |]
[| "M", 0.75 |]
[| "L", 1 |]
[| "XL", 0.75 |]
table Colors[color] = with
[| as color, as Weight |]
[| "white", 1 |]
[| "red", 2 |]
[| "green", 0.5 |]
[| "blue", 0.75 |]
[| "black", 1 |]
table Catalog = with
[| as Size, as Color, as AltColor, as Price |]
[| "S", "red", "blue", 9.99 |]
[| "M", "blue", "white", 10.99 |]
[| "XL", "black", "green", 15.49 |]
expect Catalog.size = Catalog.Size
expect Catalog.color = Catalog.Color
table Variant = cross(Sizes, Colors)
Variant.W = Sizes.Weight * Colors.Weight
// When both dimensions are provided (by name), behaves as a normal lookup.
WhiteLarge = Variant.Weight[size: "L", color: "white"]
Catalog.Alt = Variant.W[size: Catalog.size, color: Catalog.AltColor]
// If a single dimension is provided by name, behavior depends on whether key
// is a scalar or not.
// If scalar, the result is a vector in the other table of the cross-table:
Colors.Small = Variant.W[size: "S"]
Sizes.Blue = Variant.W[color: "blue"]
// If non-scalar, the lookup will automatically look for the other
// dimension in the key's table.
Catalog.Alt = Variant.W[color: Catalog.AltColor] // implicit 'size: Catalog.size'
// Note that if no label is provided, the rightmost dimension is assumed:
Catalog.Alt = Variant.W[Catalog.AltColor] // same as the abvoe
Error message:
Error on line 17, column 18: Catalog.Color
can only be assigned a value with dimension Color
.
Samely, the table in the section Filtered Aggregation
Pid Sold
apple 10
orange -3
banana -2
should have been
Pid Sold
apple 3
orange -2
banana -3
table Orders = with
[| as Pid, as OrderDate, as Quantity |]
[| "apple", date(2020, 4, 15), 3 |]
[| "apple", date(2020, 4, 16), 7 |]
[| "orange", date(2020, 4, 16), 2 |]
table Products = with
[| as Pid, as MyDefault |]
[| "apple", -1 |]
[| "orange", -2 |]
[| "banana", -3 |]
Products.Sold = sum(Orders.Quantity)
when (Orders.OrderDate < date(2020, 4, 16))
default Products.MyDefault
by Orders.Pid
at Products.Pid
show table "Products" with
Products.Pid
Products.Sold
The following code in the section Empty Group
is supposed to be
| Pid | Sold |
| :-------: | :---: |
| apple | 10 |
| orange | 2 |
| banana | -3 |
instead of
| Pid | Sold |
| :-------: | :---: |
| apple | 10 |
| orange | 2 |
| banana | -2 |
table Orders = with
[| as Pid, as OrderDate, as Quantity |]
[| "apple", date(2020, 4, 15), 3 |]
[| "apple", date(2020, 4, 16), 7 |]
[| "orange", date(2020, 4, 16), 2 |]
table Products = with
[| as Pid, as MyDefault |]
[| "apple", -1 |]
[| "orange", -2 |]
[| "banana", -3 |]
Products.Sold = sum(Orders.Quantity)
default Products.MyDefault
by Orders.Pid
at Products.Pid
show table "Products" with
Products.Pid
Products.Sold
With the change of indentation handling, only one indentation is required (and necessary).
Code examples are right.
As of 24/09/2024, when indenting too much, we get an unclear compilation error in the IDE: "Found number/text/etc. but expected end-of-line.". In this case, reduce the number of indentations to 1 only.
A small table that contains at least one enum vector may not have more than 100 million lines.
A small table that contains at least one embedding vector may not have more than 1 million lines.
Ref 10095235 and linked SKUs do not exist, it should be 10095232 (2 at the end instead of 5)
To complete this, ranvar values are bounded to 67108800 (roughly 2^26), enabling ranvar to have a bounded storage need.
Creating a ranvar with values outside of this bound will raise error "Cannot create ranvar with domain [x .. y]".
If you want to rank in decreasing order, you can either:
1 - scan with a minus sign
table T = with
[| as N |]
[| 0 |]
[| 1 |]
[| 2 |]
[| 3 |]
T.rk = rank() scan -T.N
show table "" a1b4 with
T.N
T.rk
2 - Use rankrev function (not documented but similar to rank function)
table T = with
[| as N |]
[| 0 |]
[| 1 |]
[| 2 |]
[| 3 |]
// equivalent to rank() scan -T.N
T.rk = rankrev() scan T.N
show table "" a1b4 with
T.N
T.rk
If you want to rank in decreasing order, you can either:
scan with a minus sign
```envision
table T = with
[| as N |]
[| 0 |]
[| 1 |]
[| 2 |]
[| 3 |]
T.rk = rank() scan -T.N
show table "" a1b4 with
T.N
T.rk
```
or use rankrev function
table T = with
[| as N |]
[| 0 |]
[| 1 |]
[| 2 |]
[| 3 |]
// equivalent to rank() scan -T.N
T.rk = rankrev() scan T.N
show table "" a1b4 with
T.N
T.rk
The documentation is not up to date, we need to add a "," between each option (start, end, horizon...)
Thanks for pointing this out. I had the same issue and also resolved it by adding a comma at the end of lines 24 and 25 in the labeled arguments (advanced) section.
Quick reminder that U.N
goes starts at 1 and goes up to N.
U.N
is in [1..N]
If you have nothing to split on (the cell is empty) then the line is dropped. If you have a content but no occurence of the separator, the line is kept (= splitted over 1 line).
Using the split option at the read stage, on lines where the splitted column is empty will drop the line altogether. This behaviour is different from the extend.split which keeps lines even when the split content is empty.
That is not true if you split at the read stage. In that case, the line is dropped if you have nothing to split on.
In multiple examples on this page (forest.regress, StyleCode, etc),
newline-separated parameters are not supported by the playground, throwing error.
Adding a ',' or a ';' (depending on what the 'one-line' grammar requires) will solve the issue.
There are multiple valuations that can be attributed to inventory depending on the task at hand, however for a MRO, the most common valuation is the fair market value. This valuation is defined as how much it would cost to buy a comparable equipment or conversely how much the company would make if selling the equipment on a marketplace like ILS.
If you do not have access to the historical data reflecting the transactions that have been made to acquire the parts, then, the most common approach consists of going back to the suppliers asking for a quote (RFQ) for the equipment. This will give you a baseline for a new equipment. With this baseline, you can derive the value of the units you have considering how much flight hours and flight cycles they have in them (considering rotables). Similarly, ILS and other comparable marketplaces are useful to survey prices of parts.
If you have a price per unit (historical transactions), then, you can apply this per-unit price as the baseline for the valuation of the inventory. You only need to discount the flight cycles and flight hours if the unit is a rotable with codified lifespan. If the inventory is old and is intended for aging fleets, then, this price might have to be depreciated because there might never be any further demand for the inventory. Although the opposite happens once in a while: the OEM has stopped producing the part, and the price of the last units on the market skyrocket.
The MTBF doesn't tell you how much your inventory is worth. It only tells you about your expected ongoing rate of component changes.
Likewise, the lead time doesn't you the inventory value either. It only tells you how proactive you need to be to reorder "soon enough" to maintain the desired quality of service.
In general, market prices are the best indicators but getting those prices is time-consuming. So the quality of the fair market value estimate is a tradeoff between what is at stake, and the labor costs involved to refine the figures.
As of July 2024, the limit of exported files is 200.
- Regular percentage with 2 digits: excelFormatPercent = "0.00%"
- Percentage with 6 digits (for example: fillrate display): excelFormatFR = "0.000000%"
- Percentage with 6 digits and plus sign for positive values (for example: fillrate increase display): excelFormatFRIncrease = "+0.000000%;-0.000000%;0%"
- Price in dollars: excelFormatUSD = "[$$-409] #,##0.00"
- Price in dollars (accounting): excelFormatAccountingUSD = "_-\[$$-409]* # ##0.00_ ;_-\[$$-409]* -# ##0.00\ ;_-\[$$-409]* -_ "
The full excel format documentation is available here https://ecma-international.org/publications-and-standards/standards/ecma-376/
Part 1
Section 18.8.31
I wanted to share a link to this highly customizable Beer Game simulation, made by Zensimu.
You can even simulate events such as quality issues, lead time delays, activate or deactivate collaboration/information-sharing.
It was featured in an interview made with Lokad's CEO Johannes Vermorel and Conor Doherty: https://www.lokad.com/tv/2023/10/30/supply-chain-board-games/
Thank you for explaining this very clearly. I understand we want to take all relevant raw data untouched and store it in a data lake. By keeping data storage and data processing separate, we can enable scalability and experimental optimization opportunities.
"Lokad is an analytical layer that operates on top of the client’s existing transactional systems. In other words, Lokad does not replace the ERP; it supplements it with predictive optimization capabilities that realistically cannot be implemented as part of a traditional transactional system."
I misspoke in my previous question; thank you for correcting me. I definitely need to further explore the architecture of data storage and data processing within this analytical engine. Thank you for your thorough response, Joannes.
Supervised learning is used all over the place for the main probabilistic forecasting tasks: part requests (number of units), scraps (number of units), turn-around time (number of days), etc. Unsupervised learning, or rather self-supervised learning, is used for master data improvement. For example to identifying faulty or missing compatibilities between aircraft types and PN), or to identify misclassified PN within the hierarchy, or to identify incorrect stock on hand values, etc. Then, stochastic optimization is applied on top of those probabilistic predictions to generate the supply chain decisions.
Beware, all those calculations should not be done within a data lake. The purpose of the data lake should only be to collect and serve the data "as is". It should not even attempt at adding intelligence.
The high-level process is the same for all verticals, it's the fine print that varies (which sort of forecasts? which sort of decisions? etc).
I appreciate your candid response. After exploring the antipatterns and the QSC philosophy, I've realized that some organizations are not as API-minded by design (culturally). Steering the ship towards the QSC feels like stepping on leadership toes, potentially making one a martyr for the cause. But I love this analogy and have been doing so ever since this remark. Additionally, I've observed that pride often leads people to prefer internal ideas over external suggestions. Navigating emotional intelligence, professional tact, and business interactions has taught me that leadership often takes precedence over coding numerical recipes.
Hypothetically, consider a B2B aerospace enterprise with historically intermittent and messy data. It would require extensive collaboration with functional experts to create the JPM you've described. Many leaders (nodes) downstream believe data sharing is already enough and are protective of their proprietary information, necessitating new agreements. These entities also have become adversarial or just unaware, focusing on their metrics without considering broader supply chain impacts.
For example, an MRO might prioritize production metrics. service, and profits, ignoring how this gamification affects the supply chain (upstream) and ultimately the end consumer. From your lectures and Lokad TV, I've learned that a well-built data pipeline is foundational to a successful QSC initiative. The biggest risk to the QSC is organizations unwilling to share their data, compounded by a lack of understanding of what data is necessary. Often, we are seeking out unknown data while navigating political hurdles (red tape) to access even a few fields from another node's table.
My question is:
How did you navigate democratizing and evangelizing the need for data sharing in a multi-echelon supply chain with differing philosophies? Did you accomplish this challenge through courageous leadership and democratization of the QSC?
For instance, when one MRO highlights issues while others are content, or when subcontractors and upstream vendors resist sharing lead time data due to proprietary or incentive concerns, how did you handle it? I truly think there is a cultural and fundamental problem with some of our industry's supply chain's philosophy of data sharing.
So, we can share via flat files (with red tape), but is that truly sustainable? Or should that be just enough to show proof of value? We are probably stuck not knowing what is needed to share. And so perhaps there is hope, but again, once an organization gets a whiff of what the other is up to, they may block your sharing capabilities due to poor policy and lack of understanding of the objective. "You're trying to forecast?! We already do that, trust our numbers! [Buys 1000, uses none of it for 5 years, no one held responsible, money lost]"
Thank you for your answer 7 months ago. It certainly helps!
Respectfully,
Note that the interval over
operates on is a value delimiter and not an index delimeter. In the example above ```envision
over Orders.OrdersDate = [-1..0]```
doesn't sum over the current and previous line but on all lines where the OrdersDate >= current OrdersDate - 1 and OrdersDate <= current OrdersDate
Property:
seriesLegendTooltip
Description:
Sets the tooltip of the series (in the legend)
Available in (that I know of):
linechart > series
chart > block > plotxy > series
chart > block > plot > series
chart > block > scatter > series
*Property:*
seriesLegendTooltip
*Description:*
Sets the tooltip of the series (in the legend)
*Available in (that I know of):*
linechart > series
chart > block > plotxy > series
chart > block > plot > series
chart > block > scatter > series
The original entry was revised and extended for publication in Foresight: The International Journal of Applied Linguistics (Q2 2024). The paper can be downloaded at the top of the page, directly under the author's name.
booleans
specifies the boolean rendering values for the boolean pipeline.
table T = with
[| as B |]
[| true |]
[| false |]
show table "" a1h3 with
T.B
T.B as "Ja/Nein" { booleans: "Ja/Nein" }
T.B as "Oui/Non" { booleans: "Oui/Non" }
T.B as "✔️/❌" { booleans: "✔️/❌" }
T.B as "True" { booleans: "True" }
T.B as "✔️" { booleans: "✔️" }
T.B as "Tru//e/N//A" { booleans: "Tru//e/N//A" }
T.B as "True///False" { booleans: "True///False" }
T.B as "True/False/Other" { booleans: "True/False/Other" }
If you need to use slicepicker instead of slicetree and you want to introduce hierarchical choices, you have the possibility of using {sliceHierarchy: } with the options : "none" | "filter" | "ask" | "clear"
The hierarchy style code impacts the next slicer
none : for full unconstrained choices
filter : removes non existant choices based on the current constraint in the slicer
ask : automatically fills the slicer to the only possible choice (if there's only one choice), otherwise clears the slicer
clear : always clear the slicer if there are no existing choices
Hover on the stylecode in the IDE for the full explanation
As of 06/02/2024:
Files.ContentChangeDate
, Files.ContentChangeHour
and Files.ContentChangeMinute
represent the modify datetime (last date when the contents of the file were changed)
Files.AnyChangeDate
, Files.AnyChangeHour
and Files.AnyChangeMinute
represent the change datetime (last date when anything happened to the path, including moving or copying the file)
The former fields Files.ModifiedDate
, Files.ModifiedHour
and Files.ModifiedMinute
are equivalent to Files.AnyChangeDate
, Files.AnyChangeHour
and Files.AnyChangeMinute
and should be decommissioned soon.
You can load (and are expected to if you intend to use them) an arbitrary number of iteration variable from the iterated table (or the common table shared if you load from different tables) e.g
table T = extend.range(5) table U[u] = by T.N mod 2 T.N2 = T.N + 2 T.N3 = T.N + 3 T.S = for tn in T.N, tn2 in T.N2, tn3 in T.N3, un in u ... return ...
Langserv may suggest to use join(T.A, G.S) instead of join(T.A; G.S). One must use a ; and not a coma.
Sorry my link was private, please find here the shareable one: https://try.lokad.com/s/argmax_example
Sorry my link was private, please find here the shareable one: https://try.lokad.com/s/ranvar_buckets_example
Sorry my link was private, please find here the shareable one: https://try.lokad.com/s/hidden_characters_example
Sorry my link was private, please find here the shareable one: https://try.lokad.com/s/extend_split_example
Sorry my link was private, please find here the shareable one: https://try.lokad.com/s/substr_example
My script was private, please find here the sharable link: https://try.lokad.com/s/over_vector_example
Note that over
can also be applied to any vector.
In this example: https://try.lokad.com/ku0dv1ujtnm66?tab=Output , we are computing all the sales done duriing a day before the ticket considered.
JIRA Doc : https://lokad.atlassian.net/browse/LK-7562
Careful as certain options (autocomplete...) can trigger a lot of computations and slow down the dashboard.
If you're looking at a hierarchical selection, consider https://docs.lokad.com/reference/stu/slicetree/
for sftp (at least), the host url should be ftp.lokad.com
You can use https://try.lokad.com to solve this workshop !
A scalar value within vector T.R = random.xxx(T.*) depends only on:
- the position of the function within the script (every call to a function random.xxx contributes to the seed)
- The number of the lines within table T
- if it is within a loop (each, for...), the number of the iteration or the epoch
As of 23/01/2024, filesUrl function is replaced by 2 functions:
/// Returns an URL for the file, identified by the hash, at the provided path in /files, and (if known at compile-time) remembers that said file is referenced by this script.
[restricted]
map fileUrl(hash: text, path: text) : text as "fileurl(txt,txt)"
/// Returns an URL for the folder at the provided path in /files, and (if known at compile-time) remembers that said folder is referenced by this script.
[restricted]
map folderUrl(path: text) : text as "folderurl(txt)"
Files tied to a path schema and historized are a pain to manage because as soon as you update the path schema, every script reading the historical files before that modification as a path schema will fail (unless you specifically decided to not read such column in the path schema).
A feature is available from the data dictionnary > stats page to manually create dummy columns matching the modified path schema on past files that have been broken by the path schema modification so that they can still be read by your scripts.
Path schema supports computed columns e.g
export schema '/clean/SalesOrders.ion' with schema Schemas.SalesOrders NetAmountEUR : number = forex(schema.NetAmount, schema.Currency,"EUR", schema.OrderDate) UnitPriceEUR : number = forex(schema.UnitPrice, schema.Currency,"EUR", schema.OrderDate)
This is a nice solution to save some file storage for redundant columns.
It is possible in the IDE to select a show table section, right click and use the "Create schema from show" cmdlet.
Here is the list of available icons : https://docs.lokad.com/reference/list-of-icons/
Thanks for the notes!
Great talk - some notes/rough translation. The questions in the Q&A are a little difficult to hear :)
https://pastebin.com/9Vc8JGqJ
If the date of your forex is in the future, by default forex() returns the rate of lastForex().
If the currency is unknown, by default forex() returns the initial price.
"The markdown datatype is restricted to the Scalar table." is not valid anymore. You are now able to have sliced markdown tiles. You must however use Slices table.
Containers from Asia take approximately 2-4 weeks longer and costs are more than doubling.
List of named colors available: https://developer.mozilla.org/en-US/docs/Web/CSS/named-color
Great, Thanks
Everything works perfectly except the suppliers table where Suppliers primary key column miss (There is only Leadtime column).
But all columns display perfectly in the first workshop playground.
The playground has been fixed.
/// Returns its argument as-is. If the path is known at compile-time and points to /files, remembers that said file is referenced by this script.
[restricted]
map downloadUrl(fullpath: text) : text as "downloadurl(txt)"
/// Returns an URL for the file with the provided hash, to be downloaded as the provided name.
[restricted]
map downloadUrl(hash: text, name: text) : text as "downloadurl(txt,txt)"
/// Returns an URL for the folder at the provided path in /files, and (if known at compile-time) remembers that said folder is referenced by this script.
[restricted]
map filesUrl(path: text) : text as "filesurl(txt)"
Thank you
Working on the issue. Sorry, for the delay. Best regards, Joannes
Hello, please how to download the data ?
Even in the playground there is an error "Maximum table size is 1000000" so can't see the output.
In a recent dialogue, Conor Doherty of Lokad conversed with Joannes Vermorel and Rinat Abdullin about generative AI’s impact on supply chains. Vermorel, Lokad’s CEO, and Abdullin, a technical consultant, discussed the evolution from time series forecasting to leveraging Large Language Models (LLMs) like ChatGPT. They explored LLMs’ potential to automate tasks, enhance productivity, and assist in data analysis without displacing jobs. While Vermorel remained cautious about LLMs in planning, both acknowledged their utility in composing solutions. The interview underscored the transformative role of AI in supply chain management and the importance of integrating LLMs with specialized tools.
"The more ill-structured the domain, the poorer the guidance for knowledge application that ‘top-down’ structures will generally provide. That is, the way abstract concepts (theories, general principles, etc.) should be used to facilitate understanding and to dictate action in naturally occurring cases becomes increasingly indeterminate in ill-structured domains."
Shamelessly copy-pasting an ELI5 from Reddit on how private/public key work. Nothing fancy once explained :)
https://www.reddit.com/r/explainlikeimfive/comments/1jvduu/eli5_how_does_publicprivate_key_encryption_work/
---
The basis is really simple:
Imagine you have a computer program that will allow you to encrypt a text file or digital document by using either one of two passwords, so that once you freely choose any one of the two passwords for encrypting, then decryption can only be performed by using the other password. That is: you can't both encrypt and decrypt by using the same password; once you use one of the two possible passwords for encryption, then you can only decrypt by using the other password you did not use for encrypting.
This is all the technical basis you need.
But why is this technical basis so useful?
If we use intelligently that previous technical stuff, then we can get a nice security system working.
This is the trick: you keep one of the two passwords as a secret password only you know and no one else knows; this is called your "private key". And you let the other password be known by everybody; this will be your "public key".
Thanks to this, you can nicely perform two interesting tasks:
a) You can RECEIVE (not send) information in a secure manner: since everybody knows your public key, then they can encrypt any information they want to send to you by using your public key. Since the information has been encrypted by using your public key, then it can only be decrypted by using your private, secret key; and since you are the only one who knows your own private key, then you are the only person who will be able to decrypt the information that was sent to you. (If you want to SEND information to other people in a secure manner, then you'll have to know those people's respective public keys, and use these public keys for encrypting).
b) you can SEND information in such manner that you can absolutely prove that information was sent by YOU: if you want to send a certain information and you encrypt it by using your PRIVATE, SECRET key, then everybody will be able to decrypt and read that information, because the information will be decryptable by your public key and everybody knows your public key. So your information is not protected against reading, but, since it is decryptable by your public key, then it is a complete proof that the information was encrypted by your private, secret key. And since you are the only person who knows your own private, secret key, then it gets perfectly proven that the information was encrypted by you and no one else. This is why encrypting by using your own private key is also known as "digitally signing" the information you send.
You will find a safety stock calculation, with varying lead times, at:
https://www.lokad.com/calculate-safety-stocks-with-sales-forecasting/
The web page includes an illustrative Excel sheet to let you reproduce the calculation.
However, the bottom line is: safety stocks are a terrible model. See:
https://www.lokad.com/tv/2019/1/9/why-safety-stock-is-unsafe/
As a statistical answer, they are completely obsolete. Probabilistic forecast must be favored instead.
https://www.lokad.com/probabilistic-forecasting-definition/
15 months of historical data is ok-ish, it's a bit tricky to assess seasonality with less than 2 years, but it can be done as well.
Hope it helps,
Joannes
In the case of x being positive, the function returns the input text starting at the xth character. The example provided is kind of tedious with an input text of 12 characters... In this script: https://try.lokad.com/s/substr-example?tab=Output I've added a character to the input text to remove the ambiguity.
match syntax must have 2 indentations spaces .
title says it all. . . .
exp(x) cannot have x exceeding 87, otherwise the script would break
Note that exp(-1000) does not break but the value isn't computed, we all know it is 0 ;)
Unfortunately, in supply chain, things can be done "a small piece" at a time. It just doesn't work. See
https://www.lokad.com/blog/2021/9/20/incrementalism-is-the-bane-of-supply-chains/
I would have very much preferred the answer to this question to be different, to have a nice incremental path that could be made available to all employees; it would have made the early life of Lokad much easier while competing against Big Vendors.
Then, don't underestimate what a supposedly "minor" employee can do. Apathy is one of the many diseases touching large companies. When nobody cares, the one person who genuinely care ends up steering the ship. All it takes to point out the obvious as many people it takes. The flaws of the "legacy" supply chain solutions are not subtle, they are glaring.
In MRO, it boils down to: uncertainty must be embraced and quantified, varying TATs matter as much as varying consumptions, etc. See an extensive review of the challenges that need to be covered https://www.lokad.com/tv/2021/4/28/miami-a-supply-chain-persona-an-aviation-mro/
Forecasting is a mean to an end, but just a mean. Focusing on forecasting as a "stand-alone thingy" is wrong. This is the naked forecast antipattern, see https://www.lokad.com/antipattern-naked-forecasts/
For an overview on how to get a supply chain initiative organized, and launched, see https://www.lokad.com/tv/2022/7/6/getting-started-with-a-quantitative-supply-chain-initiative/
Hope it helps,
What are the steps to integrate probabilistic forecasting into the supply chain of an Aerospace MRO (i.e, similar to your work with Air France Industries), particularly when I'm a minor player (employee) handling it independently without any investment capital, but rather as part of my job responsibilities?
Additionally, as you have discussed in your YouTube videos and articles, is forecasting truly the answer, or should the focus be more on reengineering the supply chain or implementing other process modifications across different levels?
I completely agree with what was said in the previous comment: stochastic optimization will definitely enable to tackle this issue (and more) the right way.
Meanwhile, here is a piece of code that you could use to tackle the order multiplier problem, following the logic I described in my previous comment:
///## ACTION REWARD FUNCTION
///### Conversion to account for customer Order Multipliers
Skus.CustomerOrderMultiplier = 2
Skus.StockOnHandInLots = floor(Skus.StockOnHand/Skus.CustomerOrderMultiplier) //could also use round(), business assumption to be taken according to the pb treated
PO.OrderQtyInLots = floor(PO.OrderQty/Skus.CustomerOrderMultiplier)
CatalogPeriods.BaselineInLots = floor(CatalogPeriods.Baseline/Skus.CustomerOrderMultiplier)
///### Action reward call
Skus.WOOUncovDemandInLots, Skus.HoldingTime = actionrwd.reward(
TimeIndex: CatalogPeriods.N
Baseline: CatalogPeriods.BaselineInLots
Dispersion: Skus.Dispersion ///assume Dispersion is adapted to Order Multiplier change. This should be handled in previous script
Alpha: 0.05
StockOnHand: Skus.StockOnHandInLots
ArrivalTime: dirac(PO.POTimeIndex)
StockOnOrder: PO.OrderQtyInLots
LeadTime: Skus.SLT
StepOfReorder: Skus.RLT)
Skus.WOOUncovDemand = Skus.WOOUncovDemandInLots * Skus.CustomerOrderMultiplier
Skus.SellThrough = (1-cdf(Skus.WOOUncovDemand + 1)) * uniform.right(1)
Regarding the customer MOQ, provided that the customers tend to always order the MOQ or a few units above the MOQ, you could use the same logic as an approximation and treat the MOQ as an Order multiplier. I can't offer a cleaner way to cope with this unfortunately, as it would require to dedicate too much time to the problem.
Some details on what is expected when using "FTP/SFTP shares" :
Password is not needed if you are using ssh key.
Don't forget the prefix in your ssh key, for examples "ssh-rsa ABC123........."
Prefix Path can be specified if you want to grant access to a specific subfolder. Depending from which folder from Files you are sharing, you will have to use it or not. Leaving it blank makes current folder the root folder for the user.
User name generated should look like accountId_userId