📜 ⬆️ ⬇️

Analysis of the shopping cart using MS Excel and MS SQL Server

image

If you are working in the field of trade, then surely the task of analyzing the shopping basket will be of interest to you. In simple words, this task boils down to determining which goods are most often bought together with other goods. With this information, you can easily increase sales, making a display of goods in accordance with the results of the analysis, or implement a system of recommendations to the buyer when selling goods.

To solve the problem, we need the following tools:

Also for the analysis, we need sales data. Previously, I received the following sample using a report in the OLTP system (see Figure 1).

image
Fig. one.
')
In the sample there are:

Before we start analyzing the recycle bin, we’ll need to download a free Excel plug-in called Data Mining Add-ins for Excel . After installing the plug-in, the DATA MINING item will appear in the Excel main menu (see Figure 2).

image
Fig. 2

The analysis itself is performed on the server by SQL Server Analysis Services, so you need to click the button in the toolbar in the Connections group (highlighted with a red arrow in Figure 2) and establish a connection with the Analysis Services server. Initially, there will be written “No connection”, click on this button and specify the connection parameters. After that, click the “Trace” button and uncheck the “Use session models” box (see Figure 3).

image
Fig. 3

Now everything is ready for analysis. Go to Excel, press Ctrl + A to select the table, go to the "Insert" tab and click on the "Table" button (see. Fig. 4).

image
Fig. four.

After that we will see the following picture (see fig. 5).

image
Fig. five.

Now click on the “Shopping Basket Analysis” button. (Pay attention to the adjacent buttons that allow you to perform other types of data analysis, for example, “Detecting Categories”, “Forecast” and others, but this is a topic for individual articles.) In the window that opens, fill in the parameters for analysis . As a transaction (Transaction ID), select the field Doc, Item - Product, Item Value - Quantity. Press the “Run” button (see fig. 6).

image
Fig. 6

During the calculation, the program will show such a window (see Fig. 7).

image
Fig. 7

After the calculation is completed, two new sheets will be automatically added to the Excel workbook:

Consider the first received label “Shopping Basket Bundled Items”. In it, we see products that are bought together, sorted by total sales (see Fig. 8).

image
Fig. eight.

And the second table is “Shopping Basket Recommendations”. In it we see the recommendations of the following type - bought the product “Selected Item”, we recommend to buy the product “Recommendation” The data is sorted by the number of joint sales (see Fig. 9).

image
Fig. 9.

That's all. As you can see, the analysis of the shopping cart is quite simple.

Now back to the question of how to use the data. I personally offered my business the following:

If in the next quarter my innovations will bring sales growth, it will be an occasion to ask for a bonus :)

I hope this article will be useful to you. Thanks for reading.

Source: https://habr.com/ru/post/254863/


All Articles