smart-categorize

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Smart 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工具

  • categorize
    — apply pattern-based categorization rules to transactions
  • transaction_search
    — find uncategorized transactions
  • categorize
    — 对交易应用基于模式的分类规则
  • transaction_search
    — 查找未归类的交易

Workflow

工作流程

  1. Use
    transaction_search
    to find all transactions where
    category
    is null or empty.
  2. Run
    categorize
    to apply existing categorization rules (pattern matching on description field).
  3. Report how many transactions were categorized by existing rules.
  4. For remaining uncategorized transactions, group by vendor/description similarity.
  5. Suggest category assignments for each vendor group (e.g., "SPOTIFY" -> Entertainment, "SHELL OIL" -> Transportation).
  6. Ask the user to confirm or adjust the suggested categories.
  7. Apply confirmed categories and optionally save new categorization rules for future imports.
  1. 使用
    transaction_search
    查找所有
    category
    为空的交易。
  2. 运行
    categorize
    以应用现有的分类规则(对描述字段进行模式匹配)。
  3. 报告有多少交易通过现有规则完成分类。
  4. 对剩余未归类的交易,按商家/描述相似度分组。
  5. 为每个商家组建议分类分配(例如:"SPOTIFY" → 娱乐,"SHELL OIL" → 交通)。
  6. 请求用户确认或调整建议的分类。
  7. 应用确认的分类,并可选择保存新的分类规则以供未来导入使用。

Without Wilson

无Wilson的替代方案

You can categorize transactions manually in a spreadsheet:
你可以在电子表格中手动分类交易:

Setting Up Category Rules in Excel/Sheets

在Excel/Sheets中设置分类规则

  1. Create a reference sheet called "Rules" with two columns:
    Pattern
    and
    Category
    .
  2. Add your vendor patterns:
    PatternCategory
    AMAZONShopping
    WHOLE FOODSGroceries
    SHELLTransportation
    NETFLIXEntertainment
    STARBUCKSDining
  3. In your transactions sheet, use a lookup formula in the Category column:
    • Excel:
      =IFERROR(INDEX(Rules!B:B,MATCH("*"&"AMAZON"&"*",Rules!A:A,0)),"Uncategorized")
      — but this only works for exact matches.
    • Better approach with Excel: Use a helper column with
      =SUMPRODUCT
      or VBA macro to do partial matching.
    • Google Sheets:
      =IFERROR(VLOOKUP("*"&A2&"*",Rules!A:B,2,FALSE),"Uncategorized")
      does not support wildcards in VLOOKUP.
    • 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")))
  1. 创建一个名为“Rules”的参考表格,包含两列:
    Pattern
    Category
  2. 添加你的商家模式:
    PatternCategory
    AMAZONShopping
    WHOLE FOODSGroceries
    SHELLTransportation
    NETFLIXEntertainment
    STARBUCKSDining
  3. 在交易表格中,在Category列使用查找公式:
    • Excel
      =IFERROR(INDEX(Rules!B:B,MATCH("*"&"AMAZON"&"*",Rules!A:A,0)),"Uncategorized")
      — 但这仅适用于精确匹配。
    • Excel的更佳方法:使用辅助列配合
      =SUMPRODUCT
      或VBA宏实现部分匹配。
    • Google Sheets
      =IFERROR(VLOOKUP("*"&A2&"*",Rules!A:B,2,FALSE),"Uncategorized")
      不支持VLOOKUP中的通配符。
    • 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")))

Common Category Mapping

常见分类映射

Vendor PatternSuggested Category
AMAZON, TARGET, WALMARTShopping
WHOLE FOODS, TRADER JOE, KROGER, SAFEWAYGroceries
UBER EATS, DOORDASH, GRUBHUBDining
NETFLIX, SPOTIFY, HULU, DISNEY+Entertainment
SHELL, CHEVRON, BP, EXXONTransportation
AT&T, VERIZON, T-MOBILE, COMCASTUtilities
CVS, WALGREENS, PHARMACYHealthcare
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
    categorization_rules
    table so they persist across sessions and apply to future imports automatically.
  • 模式匹配不区分大小写,且会匹配交易描述的任意部分。
  • 规则按创建顺序应用。如果某笔交易匹配多个规则,第一个匹配的规则生效。
  • 分类不会覆盖已有分类的交易,除非你明确要求。
  • Wilson将规则存储在
    categorization_rules
    表中,因此规则会跨会话保留,并自动应用于未来的导入。