Programming Languages Applied to Logistics

Programming languages are very useful tools for companies when it comes to automating boring and repetitive tasks to focus on more creative ones. The field of logistics is no exception, with the need to automate the recollection, cleaning and preparation of forecast and inventory data, as well as to program robots in warehouses. In this post, a tour of the most popular programming languages in the sector will be made, as well as the databases from which the information can be retrieved for analysis. Additionally, the use made of these in logistics will be explained.

1.      Databases

Companies store an enormous amount of information, which is of great importance when formulating problem-solving strategies. In the field of logistics this led to a huge headache, because the information was so much that it was difficult to filter and process, so most companies ended up being forced to deal with problems in the dark. The apparition of databases solved this problem, allowing the companies to store both internal and external information. These come in different forms depending on the needs of the company:

  • Relational databases (SQL): adapted to small or medium-sized data, offering information structured in tables that can be related to each other through a unique identifier. This structure removes redundancy from the information and makes it error-proof, but it leads to slow information gathering in case there is a lot of information stored (the delay can be noticeable after half a minute).

For example, if we want to control the inventory, we would have three tables, one for the products (with all the information related to them), another for the stocks (with information about inputs and outputs about a determined product) and a third one in charge of relating a product with its stocks. Through a query, and thanks to the relationship between tables, we can get all the inputs and outputs of a product of interest.

  • Non-Relational Databases (NoSQL): it comes handy when dealing with huge amounts of data, since the lack of structure leads to the data being gathered more quickly. Now the data is grouped in documents or in key-value pairs that contain all the information related to the topic, with more complex properties being represented by an incrusted document or by their own group of key-value pairs, which also simplifies the development of the queries. The problem comes when it comes to correcting errors, since the same value for a determined property can appear incorrectly in a couple of records.

The scalability of Non-Relational Databases allows to distribute data into multiple nodes or locations, so it is common to apply them together with Big Data solutions.

Continuing with the previous example, the design of the information would depend on how we are interested in obtaining it. If we want to obtain all the inputs and outputs of our warehouse, we would have an “Inputs” document and another called “Outputs”. If instead we want all the outputs and inputs of a certain product, we would have a document called “Products” with an “input” property and another called “output” that would contain a list of the inputs and outputs of said product.

Another important container of information are the Excel sheets themselves, with the possibility of executing SQL queries on them through the Windows Power Automate tool.

2.      Visual Basic

Visual Basic is an object-oriented programming language from Microsoft, so it can be used both to develop desktop applications for Windows or to automate processes in Excel sheets trough macros, with the latter being the most popular solution for the field of logistics, because their simplicity and easiness of implementation.

An example of its use is the creation of an inventory management application that allows the introduction of new records in Excel sheets by filling in forms, with the necessary calculations being executed in the background and with some fields being able to be filled by selecting from a list of records. This allows you to focus on the tasks of inventory management without having to worry about the correct use of mathematical formulas and the properties of a determine product.

An example of this can be seen in the following video:

3.      M & DAX

With Excel 2010 two modules were introduced that became a great alternative to macro programming: Power Pivot and Power Query. While Power Query allows you to prepare data from Excel sheets for further analysis, Power Pivot allows you to convert this information into related tables similar to those described in the database section.

For example, with Power Pivot we can have three tables: year, month and type of product, and make the demand information in the Excel sheet vary depending on the year, month and type of product chosen through these tables.

In the case of Power Query, if we have a column about sales we can change the currency, and even separate the decimals by commas instead of periods to make easier to represent that information with graphs.

A lot of features are available directly through the interface. But complex functionalities require coding in M (Power Query) and DAX (Power Pivot).

These languages are also used in Power BI, a Business intelligence Software extremely popular across many industries.

4.      Python & R

Both Python and R are programming languages that are often used in logistics for data processing and visual representation, with the main difference between the two being that R is designed exclusively for that purpose while Python is more versatile and can be used for another kind of tasks.

For example, Python is also commonly used to develop mathematical optimization algorithms that allow, among other things, to optimize the transport routes of our trucks or ships in order to save on gasoline costs.

5.      C/C++ and Java

C# and Java are the most common programming languages for warehouse automation/mechanization. Said automation includes, among others, the unloading of trucks and the loading/unloading on pallets, shelves and racks.

To facilitate development, existing APIs such as RoboDK (in the case of C#) or Robotics API (in the case of Java) are usually used.

6.      ABAP & RPG

ABAP is a programming language that allows you to automate tasks in the SAP ERP, such as queries and modifications in data tables through reports, as well as creating custom screens.

On the other hand, RPG is in charge of generating reports in IBM’s ERPs.

7.      No-Code Trend

No-Code is a movement that seeks the “democratization” of programming, in the sense that it seeks to make programming accessible to everyone, through cloud-based graphical tools that allow collaborative creation of applications, with the consequent advantages of speeding up development and saving costs.

In logistics, it is usually used to optimize the supply chain through the collection and presentation of data for subsequent analysis, as well as for the creation of centralized information banks among all warehouses in order to identify certification failures, alert on expirations and provide the necessary information on employee safety training.

The disadvantages are the strong dependence on the No-Code platform used, since it is not possible to transfer the application to another platform, as well as low customization that prevents it from adapting to all companies.

8.      Bibliography

https://towardsdatascience.com/supply-chain-optimization-with-python-23ae9b28fd0b

https://supplychaingamechanger.com/how-to-optimize-supply-chain-using-sql-and-big-data/

https://support.microsoft.com/es-es/office/power-pivot-informaci%C3%B3n-general-y-aprendizaje-f9001958-7901-4caa-ad80-028a6d2432ed

https://www.roboticsapi.org

https://learn.microsoft.com/es-es/power-automate/desktop-flows/how-to/sql-queries-excel

https://acropolium.com/blog/low-code-logistics/

Leave a comment