In this example, JoinColumns = 'product'. The function tries to identify segments of customers that often purchase the same products.
Input
- InputTable: sales_transaction, as in CFilter Example: Filter by Product
SQL Call
SELECT * FROM CFilter ( ON sales_transaction AS InputTable OUT TABLE OutputTable (cfilter_output1) USING TargetColumns ('customer_segment') JoinColumns ('product') ) AS dt;
Output
message ----------------------------------- Output table created successfully (1 row)
SELECT * FROM cfilter_output1;
col1_item1 col1_item2 cntb cnt1 cnt2 score support confidence lift z_score -------------- -------------- ---- ---- ---- ------------------ ------------------ ------------------ ------ ------------------- corporate small business 17 17 17 1.0 1.0 1.0 1.0 1.3728129459672886 home office small business 16 16 17 0.9411764705882353 0.9411764705882353 1.0 1.0 0.7844645405527365 consumer small business 13 13 17 0.7647058823529411 0.7647058823529411 1.0 1.0 -0.9805806756909198 home office consumer 13 16 13 0.8125 0.7647058823529411 0.8125 1.0625 -0.9805806756909198 consumer corporate 13 13 17 0.7647058823529411 0.7647058823529411 1.0 1.0 -0.9805806756909198 small business corporate 17 17 17 1.0 1.0 1.0 1.0 1.3728129459672886 corporate home office 16 17 16 0.9411764705882353 0.9411764705882353 0.9411764705882353 1.0 0.7844645405527365 small business home office 16 17 16 0.9411764705882353 0.9411764705882353 0.9411764705882353 1.0 0.7844645405527365 corporate consumer 13 17 13 0.7647058823529411 0.7647058823529411 0.7647058823529411 1.0 -0.9805806756909198 small business consumer 13 17 13 0.7647058823529411 0.7647058823529411 0.7647058823529411 1.0 -0.9805806756909198 consumer home office 13 13 16 0.8125 0.7647058823529411 1.0 1.0625 -0.9805806756909198 home office corporate 16 16 17 0.9411764705882353 0.9411764705882353 1.0 1.0 0.7844645405527365
Download a zip file of all examples and a SQL script file that creates their input tables from the attachment in the left sidebar.