根據【系列3-1】使用EM得到的資料,接下來我們利用SAS Enterprise Guide來進行表格的製作。
開啟SAS EG→【新增專案】

建立資料館
點選工具列【工具】→【指派專案資料館】→命名資料館【DATALIB】(命名規則:1.只能英文、數字跟底線2.不能超過8個字元3.數字不能開頭) →【下一步】→【瀏覽】→選擇資料館路徑【C:\Data-EGEMw】→【確定】→【下一步】

點選【下一步】→【完成】。

即建立資料館結果如下:
記錄檔中確認DATALIB已經成功地被指派,且路徑為C:\Data-EGEMw

左側【伺服器】→【本機】→【資料館】,確認有【DATALIB資料館】以及與C:\Data-EGEMw中相同的這4個SAS資料集,後續要將其中4個SAS資料集匯入。

◎ 合併資料
點選工具列【檔案】→【開啟】→【資料】,匯入【score_score】資料集

將視窗捲軸往右,可確認每筆資料都已得到分群結果。
點選【查詢產生器】→【聯結表格】→【增加表格】。

點選左側【伺服器】→【本機】→【資料館】→【DATALIB】→【SUMMARY】→【開啟】。

聯結表格 小知識及小叮嚀:
❶
在此是使用Customer_ID,將公司分群與彙總檔和EM所得到的所有人分群檔運用交集方式合併。
在此由於兩資料中皆有Customer_ID這個變數名稱,且此變數皆為文字變數(名稱及類型相同),所以EG會自動使用此變數將兩資料合併。
- 若您的資料變數名稱不同,您可點著某變數再拖曳到另一個變數中即可
- 若您要用非交集方式合併,您可對中間交集符號按右鍵點選屬性即可更改
❷
合併資料時須注意要用來合併的變數類型,如:此範例是使用Customer_ID將兩資料合併,則需特別注意兩資料中的Customer_ID的類型是否相同
點選【關閉】。

將【t2(SUMMARY)】拖曳至【選取資料】→變數【EM_SEGMENT】拖曳至【選取資料】位於變數Group下方→【執行】

即匯入並合併資料結果如下:

◎ 製作摘要表
點選快捷工具列【描述】→【摘要表】→將變數group拖曳至【分類變數】→變數Times、txn_days、Total price拖曳至【分析變數】→點選右方工作設定【摘要表】→將變數拖曳至表格相對位置。

將變數拖曳至相對位置→拖曳想要分析的統計量→【執行】

即製作摘要表結果如下:
由下表可知,相對少數又時常來消費,而且消費金額較多的客戶為「固定常客」的客戶。
接著,再結合前面EM所得分群結果,找出固定常客且為某群人進行分析。

◎表格分析(找出固定常客且為某群人)
回到流程圖,點選上方【處理流程】即可回到流程圖。

點選流程圖中【QUERY_FOR_score_score】資料集→點選工具列【工作】→【描述】→【表格分析】→將變數group與EM_SEGMENT拖曳至【表格變數】。

點選左側工作設定【表格】→將變數group、EM_SEGMENT拖曳至下圖的相對位置→點選左側工作設定【儲存統計值】→勾選【欄百分比】→【執行】

即製作表格分析結果如下:
由下表可知,固定常客中,以人數來說,與其他群不同的群為第1及第5群,而在固定常客中,第1群的人數較其他群多,所以可針對固定常客且為第1群的顧客制訂明年度行銷方案。

◎ 篩選並匯出資料
回到流程圖→【QUERY_FOR_score_score】資料集按右鍵→【查詢產生器】→【聯結表格】→【增加表格】。

點選左側【伺服器】→【本機】→【資料館】→【DATALIB】→【TRANSACTION】→【開啟】。

點選【關閉】。

按ctrl點選Customer_ID及SubPro_Name拖曳至【選取資料】→點選【篩選資料】→將變數group拖曳【篩選資料】→點選【值】→點選右下【取得值】→【固定常客】→【完成】

將變數EM_SEGMENT拖曳至【篩選資料】→值輸入【1】→【完成】→【變更】→選擇輸出位置→【DATALIB】→輸入資料名稱【target_customer】→【儲存】

點選【選項】→於標籤欄打上【Target_Customer】→【確定】→【執行】

即篩選並匯出資料結果如下:
請確認已出現客戶每次消費的商品小類名稱

確認C槽→Data-EGEMw中已出現【target_customer】資料集

最後我們得到了目標客群的資料,接下來要來進行購物籃分析了! Let's GO!
Tags