EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB226973: How to create a simple market basket analysis report?


Community Admin

• Strategy


Users may want to create a report similar to the table below which is outlined in the section relating to market basket analysis in the Advanced Reporting Guide:
 

ka04W000000ObsYQAS_0EM4400000029I3.jpeg

 
The following example shows the way to create a market basket analysis report with the detailed steps:

  • Create database tables and input sample data as shown below:

    ITEM_ID

    ITEM_DESC

    1

    Soda

    2

    Potatoes

    3

    Onions

    4

    Beef

    5

    Rice


     

    ORDER_ID

    ITEM_ID

    SALES_AMT

    1

    1

    1

    1

    2

    1

    2

    1

    1

    2

    2

    1

    3

    2

    1

    3

    3

    1

    3

    4

    1

    4

    1

    1

    4

    5

    1

    5

    2

    1

    5

    4

    1

    6

    1

    1

    6

    2

    1

    6

    3

    1

    7

    1

    1

    7

    2

    1

    8

    1

    1

    8

    2

    1

    8

    3

    1

    9

    3

    1

    9

    4

    1

    9

    5

    1

    10

    3

    1

    10

    4

    1

    10

    5

    1



     
  • Create Order (ORDER_ID) and Item (ITEM_ID) attributes.
     
  • Create an Item metric with the following expression:
    
    Max<FactID=[Sales Amt]>(Item@DESC) {~+, Item+}

  • Create a training metric:
    • Choose Association as a type of analysis and set the parameters to limit the scope.
ka04W000000ObsYQAS_0EM4400000029I5.jpeg
    • Select the item and transaction metric created in Step_2 and Step_3 as shown in the image below:
ka04W000000ObsYQAS_0EM4400000029Hp.jpeg
    • In the Rules to Return dialog, specify the top 3 rules by Confidence as shown in the image below:
ka04W000000ObsYQAS_0EM4400000029I1.jpeg
    • Specify the folder to output the predictive metric and its types:
ka04W000000ObsYQAS_0EM4400000029Hu.jpeg
  • Create a report with the Order, Item attributes, and the training metric. Users can apply a report filter to this report when sampling the data from a large transaction table.
     
  • Create a report with Order, Item attributes, and the predictive metrics. The top 3  recommended rules and the confidence values are displayed per the items in each order as shown in the image below:
ka04W000000ObsYQAS_0EM4400000029Hj.jpeg
  • In order to show all combinations of the itemsets, select ‘View Predicted Model’ from the context menu of the predicted metric and choose the‘View’ tab:
ka04W000000ObsYQAS_0EM4400000029Hz.jpeg
  • The table in Step_7 is not displayed in Strategy Web. Users may need to export to CSV file and import to Strategy Web using Data Import functionality.
ka04W000000ObsYQAS_0EM4400000029Hl.jpeg


KB226973


Comment

0 comments

Details

Knowledge Article

Published:

March 31, 2017

Last Updated:

December 28, 2018