smart-categorize
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSmart Categorize
智能分类
Overview
概述
Automatically categorize uncategorized transactions by matching vendor/description patterns against known rules. Uses existing categorization rules first, then suggests new rules for unmatched transactions based on common vendor names.
通过将商家/描述模式与已知规则匹配,自动分类未归类的交易。首先使用现有的分类规则,然后基于常见商家名称为未匹配的交易建议新规则。
Wilson Tools Used
使用的Wilson工具
- — apply pattern-based categorization rules to transactions
categorize - — find uncategorized transactions
transaction_search
- — 对交易应用基于模式的分类规则
categorize - — 查找未归类的交易
transaction_search
Workflow
工作流程
- Use to find all transactions where
transaction_searchis null or empty.category - Run to apply existing categorization rules (pattern matching on description field).
categorize - Report how many transactions were categorized by existing rules.
- For remaining uncategorized transactions, group by vendor/description similarity.
- Suggest category assignments for each vendor group (e.g., "SPOTIFY" -> Entertainment, "SHELL OIL" -> Transportation).
- Ask the user to confirm or adjust the suggested categories.
- Apply confirmed categories and optionally save new categorization rules for future imports.
- 使用查找所有
transaction_search为空的交易。category - 运行以应用现有的分类规则(对描述字段进行模式匹配)。
categorize - 报告有多少交易通过现有规则完成分类。
- 对剩余未归类的交易,按商家/描述相似度分组。
- 为每个商家组建议分类分配(例如:"SPOTIFY" → 娱乐,"SHELL OIL" → 交通)。
- 请求用户确认或调整建议的分类。
- 应用确认的分类,并可选择保存新的分类规则以供未来导入使用。
Without Wilson
无Wilson的替代方案
You can categorize transactions manually in a spreadsheet:
你可以在电子表格中手动分类交易:
Setting Up Category Rules in Excel/Sheets
在Excel/Sheets中设置分类规则
-
Create a reference sheet called "Rules" with two columns:and
Pattern.Category -
Add your vendor patterns:
Pattern Category AMAZON Shopping WHOLE FOODS Groceries SHELL Transportation NETFLIX Entertainment STARBUCKS Dining -
In your transactions sheet, use a lookup formula in the Category column:
- Excel: — but this only works for exact matches.
=IFERROR(INDEX(Rules!B:B,MATCH("*"&"AMAZON"&"*",Rules!A:A,0)),"Uncategorized") - Better approach with Excel: Use a helper column with or VBA macro to do partial matching.
=SUMPRODUCT - Google Sheets: does not support wildcards in VLOOKUP.
=IFERROR(VLOOKUP("*"&A2&"*",Rules!A:B,2,FALSE),"Uncategorized") - Practical Google Sheets approach:
=IF(REGEXMATCH(A2,"(?i)amazon"),"Shopping", IF(REGEXMATCH(A2,"(?i)whole foods|trader joe"),"Groceries", IF(REGEXMATCH(A2,"(?i)shell|chevron|exxon"),"Transportation", "Uncategorized")))
- Excel:
-
创建一个名为“Rules”的参考表格,包含两列:和
Pattern。Category -
添加你的商家模式:
Pattern Category AMAZON Shopping WHOLE FOODS Groceries SHELL Transportation NETFLIX Entertainment STARBUCKS Dining -
在交易表格中,在Category列使用查找公式:
- Excel:— 但这仅适用于精确匹配。
=IFERROR(INDEX(Rules!B:B,MATCH("*"&"AMAZON"&"*",Rules!A:A,0)),"Uncategorized") - Excel的更佳方法:使用辅助列配合或VBA宏实现部分匹配。
=SUMPRODUCT - Google Sheets:不支持VLOOKUP中的通配符。
=IFERROR(VLOOKUP("*"&A2&"*",Rules!A:B,2,FALSE),"Uncategorized") - Google Sheets的实用方法:
=IF(REGEXMATCH(A2,"(?i)amazon"),"Shopping", IF(REGEXMATCH(A2,"(?i)whole foods|trader joe"),"Groceries", IF(REGEXMATCH(A2,"(?i)shell|chevron|exxon"),"Transportation", "Uncategorized")))
- Excel:
Common Category Mapping
常见分类映射
| Vendor Pattern | Suggested Category |
|---|---|
| AMAZON, TARGET, WALMART | Shopping |
| WHOLE FOODS, TRADER JOE, KROGER, SAFEWAY | Groceries |
| UBER EATS, DOORDASH, GRUBHUB | Dining |
| NETFLIX, SPOTIFY, HULU, DISNEY+ | Entertainment |
| SHELL, CHEVRON, BP, EXXON | Transportation |
| AT&T, VERIZON, T-MOBILE, COMCAST | Utilities |
| CVS, WALGREENS, PHARMACY | Healthcare |
| VENMO, ZELLE, PAYPAL (person-to-person) | Transfers |
| 商家模式 | 建议分类 |
|---|---|
| AMAZON, TARGET, WALMART | 购物 |
| WHOLE FOODS, TRADER JOE, KROGER, SAFEWAY | 杂货 |
| UBER EATS, DOORDASH, GRUBHUB | 餐饮 |
| NETFLIX, SPOTIFY, HULU, DISNEY+ | 娱乐 |
| SHELL, CHEVRON, BP, EXXON | 交通 |
| AT&T, VERIZON, T-MOBILE, COMCAST | 公共事业 |
| CVS, WALGREENS, PHARMACY | 医疗健康 |
| VENMO, ZELLE, PAYPAL(个人对个人) | 转账 |
Important Notes
重要说明
- Pattern matching is case-insensitive and matches against any part of the transaction description.
- Rules are applied in the order they were created. If a transaction matches multiple rules, the first match wins.
- Categorization does not overwrite transactions that already have a category unless you explicitly ask.
- Wilson stores rules in the table so they persist across sessions and apply to future imports automatically.
categorization_rules
- 模式匹配不区分大小写,且会匹配交易描述的任意部分。
- 规则按创建顺序应用。如果某笔交易匹配多个规则,第一个匹配的规则生效。
- 分类不会覆盖已有分类的交易,除非你明确要求。
- Wilson将规则存储在表中,因此规则会跨会话保留,并自动应用于未来的导入。
categorization_rules