这套方式能带来什么
Datacooper 把两个引擎组合使用:cwtwb 生成 .twb/.twbx 仪表板,cwprep 生成 .tfl/.tflx Prep 数据流。
核心业务价值很直接:团队拿到的是可直接在 Tableau 产品中打开的真实文件,而不是临时截图。
步骤 1:安装并连接 MCP 工具
先把两个工具接入你的 AI 客户端,让提示词可以直接调用生成器。
# cwtwb
uvx cwtwb
# cwprep
uvx --from "cwprep[mcp]" cwprep-mcp步骤 2:用 cwtwb 生成仪表板文件
建议用 guided authoring 稳定交付:先确认数据源,再选图表基础能力,组装 dashboard 区块,最后导出。
- 核心图表:Bar、Line、Area、Pie、Map、Text
- 高级能力:Dual Axis、Heatmap、Scatterplot、URL/Filter 动作
- 配方图表:Bullet、Butterfly、Lollipop、Calendar、Donut、Bump
步骤 3:用 cwprep 生成 Prep 数据流
把清洗流程建模成节点后导出 .tfl 或 .tflx。需要评审时可输出 SQL 翻译,保证处理逻辑透明。
- 输入:SQL/Table/Excel/CSV/CSV Union
- 转换:join、union、filter、calculate、pivot/unpivot、aggregate、rename、类型转换
- 输出:可进入 Tableau 工作流的数据源结果配置
步骤 4:上线前检查
对于营销演示和试点项目,这份检查清单就够用。
- 在 Tableau Desktop 打开
.twb/.twbx,确认布局是否符合预期 - 在 Tableau Prep 打开
.tfl/.tflx,端到端执行一次 - 把提示词与输出版本一起保存,便于后续追溯
可直接复用的起步提示词
Build a weekly sales dashboard pack and a prep flow.
Dashboard side (cwtwb):
- KPI cards: Sales, Profit, Margin
- Trend: weekly sales line
- Breakdown: category bar chart
- Add one filter action from category to trend
Prep side (cwprep):
- Load orders + customers
- Remove invalid rows
- Unpivot monthly columns
- Add margin calculation
- Output final datasource files