Using The CSV Command

The CSV command works best when you use it in two steps:

Step 1: Understand Your Data

First, tell the command what you want to do. It will show you the structure of your data:

/csv show me sales data for South American countries from sales_global.csv

The command will output something like:

CSV Structure Found:
Headers: ["date", "country", "product", "sales", "revenue"]
First 5 rows:
1. date: 2024-01-01, country: Brazil, product: Widget A, sales: 150, revenue: 15000
2. date: 2024-01-01, country: Argentina, product: Widget B, sales: 120, revenue: 12000
3. date: 2024-01-01, country: Chile, product: Widget A, sales: 90, revenue: 9000
4. date: 2024-01-02, country: Brazil, product: Widget C, sales: 200, revenue: 20000
5. date: 2024-01-02, country: Peru, product: Widget B, sales: 75, revenue: 7500

Step 2: Continue Your Analysis

Now that you can see your data structure, continue with your specific analysis:

/csv Great, now calculate total revenue by country and sort from highest to lowest

Example Workflows

Sales Analysis

Step 1:
/csv analyze monthly sales by product from sales_2024.csv

Step 2:
/csv calculate the growth rate between months and highlight products growing over 10%

Customer Data

Step 1:
/csv show me customer satisfaction scores from feedback.csv

Step 2:
/csv break this down by region and show me average scores for each category

Inventory Analysis

Step 1:
/csv check inventory levels from stock_levels.csv

Step 2:
/csv identify items below reorder point and sort by current stock level

Best Practices

  1. Start Simple

    • Begin with a basic request to see your data
    • Check the column names in the structure output
    • Verify the data format in the sample rows
    • Then build your analysis
  2. Clear Requests

    • Specify the CSV file name
    • State what you want to analyze
    • Be specific about calculations
    • Mention any sorting or filtering needed
  3. Build Analysis

    • Use the column names exactly as shown
    • Reference the data types you saw
    • Specify any grouping needed
    • Indicate how you want results sorted

Tips for Success

  1. First Step

    • Always start with a request that will show you the data
    • Check column names carefully
    • Note the format of dates, numbers, etc.
    • Verify the countries, categories, or other key fields
  2. Second Step

    • Use the exact column names you saw
    • Build on what you learned about your data
    • Be specific about calculations
    • Indicate how you want results formatted

Remember: Let the first step show you what’s in your data, then build your analysis in the second step!