The number of combinations is typically reduced for a higher basket size.
Input
- grocery_transaction, as in BasketGenerator Example: Partition by tranid
SQL Call
SELECT * FROM BasketGenerator ( ON grocery_transaction PARTITION BY tranid USING TargetColumns ('item') BasketSize (4) Accumulate ('tranid') OutputCombinations ('true') ) AS dt;
Output
tranid item1 item2 item3 item4 ------ ------ ----- ----- ------- 999 butter eggs flour milk 1000 eggs flour milk spinach 999 butter eggs flour spinach 999 butter eggs milk spinach 999 butter flour milk spinach 999 eggs flour milk spinach
Download a zip file of all examples and a SQL script file that creates their input tables from the attachment in the left sidebar.