walmart-sales-analyzer

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Walmart Sales Data Deep Analyzer

沃尔玛销售数据深度分析工具

This skill is designed to help users conduct in-depth analysis of Walmart sales data, particularly exploring the relationship between sales and unemployment rates across different stores. It visually presents these trends by generating visualizations with detailed interpretations and professional HTML reports.
本技能旨在帮助用户对沃尔玛销售数据进行深度分析,尤其聚焦于探索不同门店的销售额与失业率之间的关系。它通过生成带有详细解读的可视化图表和专业HTML报告,直观呈现这些趋势。

Features

功能特性

This skill provides the following analysis and visualization features:
  1. Data Correlation Heatmap: Displays the correlation between all numerical variables in the dataset and provides a detailed interpretation.
  2. Sales vs. Unemployment Scatter Plot: Visually demonstrates the relationship between weekly sales and the unemployment rate, accompanied by a regression line, and deeply analyzes consumption resilience under economic pressure.
  3. Time Series Trend of Sales and Unemployment for Specific Stores: Tracks the trends of sales and unemployment rates over time for selected stores to analyze seasonal forces and macro trends.
  4. Comparison of Average Sales and Average Unemployment Across Stores: Compares the average sales performance of different stores with local average unemployment rates to provide suggestions for regional operational strategies.
  5. HTML Deep Analysis Report Generation: Automatically integrates all charts into a beautiful, responsive HTML report that includes detailed analysis conclusions and business recommendations.
本技能提供以下分析与可视化功能:
  1. 数据相关性热力图:展示数据集中所有数值变量之间的相关性,并提供详细解读。
  2. 销售额与失业率散点图:直观展示周销售额与失业率之间的关系,并附带回归线,深度分析经济压力下的消费韧性。
  3. 特定门店的销售额与失业率时间序列趋势:追踪选定门店的销售额与失业率随时间的变化趋势,分析季节性因素与宏观趋势的影响。
  4. 跨门店平均销售额与平均失业率对比:对比不同门店的平均销售业绩与当地平均失业率,为区域运营策略提供建议。
  5. HTML深度分析报告生成:自动将所有图表整合到一份美观、响应式的HTML报告中,报告包含详细的分析结论与业务建议。

Usage

使用方法

To use this skill, you need to provide a CSV file containing Walmart sales data. The file should contain at least the following columns:
Store
(Store ID),
Date
(Date),
Weekly_Sales
(Weekly Sales),
Unemployment
(Unemployment Rate).
要使用本技能,您需要提供包含沃尔玛销售数据的CSV文件。该文件至少应包含以下列:
Store
(门店ID)、
Date
(日期)、
Weekly_Sales
(周销售额)、
Unemployment
(失业率)。

Core Workflow

核心工作流

  1. Check Uploaded File: First, verify that a valid Walmart Sales CSV file was provided.
  2. Execute Analysis Script: Use the
    execute_skill_script_file
    tool to run the
    generate_html_report.py
    script. Pass the CSV file path to the
    input_file
    argument in the
    args
    parameter.
    • Example:
      {"skill_name": "walmart-sales-analyzer", "script_file_name": "generate_html_report.py", "args": {"input_file": "/path/to/Walmart_Sales.csv", "output_dir": "."}}
    • Note: This script automatically generates all required charts (
      correlation_heatmap.png
      ,
      sales_vs_unemployment_scatter.png
      , etc.) and the base report.
  3. Present Report: To present the results to the user via the DB-GPT UI, you must use the
    html_interpreter
    tool. Provide the
    template_path
    (
    walmart-sales-analyzer/templates/report_template.html
    ) and the necessary text data to render the report interactively. You MUST fill in ALL the placeholders dynamically based on your analysis (including ALL section titles, report titles, and analysis content, otherwise they will render as 'NA') and ensure they are translated to the user's language.
    • Example
      data
      payload: { "LANG": "en", "REPORT_TITLE": "Walmart Sales Deep Analysis Report", "REPORT_SUBTITLE": "Based on macroeconomic indicators and store performance", "EXEC_SUMMARY_TITLE": "Executive Summary", "EXEC_SUMMARY_CONTENT": "<p>Your detailed summary...</p>", "SECTION_1_TITLE": "1. Multi-dimensional Correlation Analysis", "SECTION_1_ANALYSIS": "<h3><span class="tag">Insights</span> Variable relationships</h3><ul><li>...</li></ul>", "SECTION_2_TITLE": "2. Sales vs Unemployment Regression", "SECTION_2_ANALYSIS": "<h3><span class="tag">Deep Dive</span> Resilience under pressure</h3><p>...</p>", "SECTION_3_TITLE": "3. Dynamic Trends Tracking", "SECTION_3_ANALYSIS": "<h3><span class="tag">Trends</span> Seasonal vs Macro</h3><p>...</p>", "SECTION_4_TITLE": "4. Store Performance Comparison", "SECTION_4_ANALYSIS": "<h3><span class="tag">Strategy</span> Regional operations</h3><p>...</p>", "CONCLUSION_TITLE": "Final Conclusions & Recommendations", "CONCLUSION_CONTENT": "<ol><li>...</li></ol>", "FOOTER_TEXT": "Deep Data-Driven Decisions" }
      undefined
  4. Complete Task: Call
    terminate
    with a final answer summarizing your actions.
  1. 检查上传文件:首先验证是否提供了有效的沃尔玛销售CSV文件。
  2. 执行分析脚本:使用
    execute_skill_script_file
    工具运行
    generate_html_report.py
    脚本。将CSV文件路径传递给
    args
    参数中的
    input_file
    参数。
    • 示例:
      {"skill_name": "walmart-sales-analyzer", "script_file_name": "generate_html_report.py", "args": {"input_file": "/path/to/Walmart_Sales.csv", "output_dir": "."}}
    • 注意:此脚本会自动生成所有所需图表(
      correlation_heatmap.png
      sales_vs_unemployment_scatter.png
      等)以及基础报告。
  3. 展示报告:要通过DB-GPT UI向用户展示结果,您必须使用
    html_interpreter
    工具。提供
    template_path
    walmart-sales-analyzer/templates/report_template.html
    )和必要的文本数据以交互式渲染报告。您必须根据分析结果动态填充所有占位符(包括所有章节标题、报告标题和分析内容,否则它们将显示为'NA'),并确保翻译为用户使用的语言。
    • 示例
      data
      负载:
      json
      {
        "LANG": "en",
        "REPORT_TITLE": "Walmart Sales Deep Analysis Report",
        "REPORT_SUBTITLE": "Based on macroeconomic indicators and store performance",
        "EXEC_SUMMARY_TITLE": "Executive Summary",
        "EXEC_SUMMARY_CONTENT": "<p>Your detailed summary...</p>",
        "SECTION_1_TITLE": "1. Multi-dimensional Correlation Analysis",
        "SECTION_1_ANALYSIS": "<h3><span class=\"tag\">Insights</span> Variable relationships</h3><ul><li>...</li></ul>",
        "SECTION_2_TITLE": "2. Sales vs Unemployment Regression",
        "SECTION_2_ANALYSIS": "<h3><span class=\"tag\">Deep Dive</span> Resilience under pressure</h3><p>...</p>",
        "SECTION_3_TITLE": "3. Dynamic Trends Tracking",
        "SECTION_3_ANALYSIS": "<h3><span class=\"tag\">Trends</span> Seasonal vs Macro</h3><p>...</p>",
        "SECTION_4_TITLE": "4. Store Performance Comparison",
        "SECTION_4_ANALYSIS": "<h3><span class=\"tag\">Strategy</span> Regional operations</h3><p>...</p>",
        "CONCLUSION_TITLE": "Final Conclusions & Recommendations",
        "CONCLUSION_CONTENT": "<ol><li>...</li></ol>",
        "FOOTER_TEXT": "Deep Data-Driven Decisions"
      }
  4. 完成任务:调用
    terminate
    并附上总结操作的最终回复。

Script List

脚本列表

  • scripts/generate_html_report.py
    : Recommended, generates an HTML report containing all charts and deep analysis with one click.
  • scripts/generate_correlation_heatmap.py
    : Generates a data correlation heatmap.
  • scripts/generate_sales_unemployment_scatter.py
    : Generates a scatter plot of sales vs. unemployment rate.
  • scripts/generate_time_series_trend.py
    : Generates a time series trend chart for a specific store.
  • scripts/generate_store_avg_comparison.py
    : Generates a comparison chart of average values across stores.
  • scripts/generate_html_report.py
    推荐使用,一键生成包含所有图表和深度分析的HTML报告。
  • scripts/generate_correlation_heatmap.py
    :生成数据相关性热力图。
  • scripts/generate_sales_unemployment_scatter.py
    :生成销售额与失业率散点图。
  • scripts/generate_time_series_trend.py
    :生成特定门店的时间序列趋势图。
  • scripts/generate_store_avg_comparison.py
    :生成跨门店平均值对比图。

Templates

模板文件

  • templates/report_template.html
    : HTML style template used to generate the deep analysis report.
  • templates/report_template.html
    :用于生成深度分析报告的HTML样式模板。

Important Notes

重要说明

  • Language Requirement: You MUST ensure that your output language exactly matches the language used by the user in their input/request.
  • All charts support multi-language display.
  • The report template uses a responsive design suitable for viewing on different devices and provides detailed analysis interpretations and business suggestions.
  • 语言要求:您必须确保输出语言与用户输入/请求中使用的语言完全一致。
  • 所有图表支持多语言显示。
  • 报告模板采用响应式设计,适合在不同设备上查看,并提供详细的分析解读和业务建议。