• Home
  • FAQ
  • Courses
  • Research
  • Posts
  • Teaching

On this page

  • 1 How to Direct Your AI Analyst - The Art of the Prompt
  • 2 Introduction to the AI Chatbot
  • 3 Introduction to the Analyst’s Lab - Notebooks
  • 4 The Full Workflow - From AI Chatbot to Notebook
  • 5 Appendix: Data and Course Resources
    • 5.1 Sample Data
    • 5.2 Data Dictionary

A Practical AI-Augmented Analyst Workflow

1 How to Direct Your AI Analyst - The Art of the Prompt

Objective: This segment will close the “prompting gap” that many new users experience with AI. By the end of this segment, you will understand the framework for conducting a structured, effective AI dialogue, moving from simple questions to a sophisticated, iterative conversation that produces high-quality analytical insights.

1.0.1 Part 1: The Mindset Shift - From Search Engine to Analyst

The most common mistake when first using a generative AI for data analysis is to treat it like a search engine. We are used to typing a few keywords into Google and getting a list of links. This is a search for a pre-existing answer.

An AI chatbot is different. It is not a library of answers; it is a reasoning engine. You are not “finding” an analysis; you are commissioning one. Your role is not to be a searcher, but a director. You must provide clear, specific instructions, just as you would to a junior data analyst on your team.

  • A search query is a request for information.
  • A prompt is a set of instructions for a task.

1.0.2 Part 2: The Anatomy of a Powerful Initial Prompt (The P-C-T-F Framework)

A powerful initial prompt is the foundation of a successful AI dialogue. It gives the AI all the information it needs to perform the task correctly on the first try. A great way to structure your prompts is with the P-C-T-F Framework.

  • Bad Example (Too General): A prompt like “Analyze my Superstore data” is too vague. The AI doesn’t know your goal, who you are, or what to look for. It will likely give you a very generic summary of the file (e.g., “This file contains 21 columns including Sales and Profit…”) which is not a useful analysis.

  • Good Example (Specific & Actionable): Let’s build a prompt using the P-C-T-F framework.

    • Persona: “Act as a business data analyst.”
    • Context: “The goal is to prepare a summary for a marketing meeting to discuss regional performance.”
    • Task: “Using the Orders sheet from the attached Superstore.xlsx file, calculate the total profit for each Region.”
    • Format: “Present the result as a simple markdown table, sorted from highest to lowest profit.”

This good prompt tells the AI its role, the business goal, the exact task to perform, and how to structure the output, leading to a much more useful and immediate result.

1.0.3 Part 3: The Art of the Follow-up - A Three-Step AI Dialogue Model

A great initial prompt is just the start of the conversation. The real power of AI-augmented analysis comes from the follow-up dialogue, where you use your own critical thinking to guide the AI to deeper insights. A productive conversation follows a natural, three-step flow.

Let’s assume our initial prompt was: “Act as a business analyst. Using the Orders sheet in the attached data, what are the top 3 product categories by total profit?”

Step 1: Clarify & Drill Down First, make sure you understand the initial response and get more detail on the most interesting part. This is where you move from a high-level summary to a specific area of interest.

  • Goal: To focus the analysis on a key finding.
  • Example Follow-up Prompt: “That’s helpful. For the ‘Technology’ category only, show me the profit by sub-category.”

Step 2: Question & Hypothesize Next, use your analytical mind to ask “why?” This prompts the AI to connect different data points to suggest potential causes for a finding.

  • Goal: To move from observing “what” is happening to exploring “why” it might be happening.
  • Example Follow-up Prompt: “Why is ‘Furniture’ profit so low? Compare its average discount to other categories.”

Step 3: Challenge & Refine Finally, act as the director. Challenge the AI’s initial approach and ask it to refine the analysis based on your own critical thinking. This is the most advanced step, where you guide the AI to a better, more robust analysis.

  • Goal: To improve the quality and relevance of the analysis itself.
  • Example Follow-up Prompt: “Is total profit the best metric here? Redo the analysis using profit margin (Profit / Sales) instead and tell me what changes.”

By following this Clarify -> Question -> Challenge model, you can transform a simple Q&A session into a powerful analytical dialogue that uncovers deep and actionable insights.

2 Introduction to the AI Chatbot

Objective: This segment provides a hands-on walkthrough of the AI chatbot interface we will use for our analysis. By the end of this segment, you will know how to access the tool, upload your data, and begin a well-structured analytical dialogue using the P-C-T-F framework.

Tool: We will be using the free version of Google Gemini for this tutorial and for your final project.

2.0.1 Part 1: Accessing and Setting Up Your Environment

First, we need to open the tool and prepare it for our analysis.

  • Navigate to the Website: Open a web browser and go to the Google Gemini website: gemini.google.com
  • Sign In: If you are not already logged in, sign in with your Google account. You will be presented with the main chat interface. It’s a clean page with a text box at the bottom where you will type your prompts.
  • Start a New Chat: It’s a best practice to start a new chat for each new project or distinct analysis. This keeps your conversations organized. If you have old conversations open, you can start a new one by clicking the “+ New chat” button, usually located in the top-left corner.

2.0.2 Part 2: Uploading Your Data File

Now, we need to provide the AI with the data it will analyze.

  • Locate the Upload Button: At the bottom of the screen, in the text box where you type your prompts, you will see several icons. Look for the paperclip icon (📎). This is the “Attach files” or “Upload” button.
  • Select the File: Click the paperclip icon. A dialog box will open, allowing you to browse your computer for a file. Navigate to where you have saved your Superstore.xlsx file and select it.
  • Confirm the Upload: After you select the file, Gemini will process it. You will see the file appear just above the text box, confirming that it is ready for analysis. The AI may also give you a brief message like, “Superstore.xlsx has been uploaded. What would you like to know about this file?”

Your environment is now set up. You have an active chat session, and the AI has access to your dataset.

2.0.3 Part 3: Asking Your First Analytical Question

This is where we put the theory from Segment 1 into practice. We will not ask a vague question. Instead, we will use the full P-C-T-F framework to commission a specific piece of analysis.

  • Construct Your Prompt: In the text box, you will now type your well-structured prompt. Let’s use the same “Good Example” from the previous segment. Type the following into the prompt box:

    Act as a business data analyst. The goal is to prepare a summary for a marketing meeting to discuss regional performance. Using the Orders sheet from the attached Superstore.xlsx file, calculate the total profit for each Region. Present the result as a simple markdown table, sorted from highest to lowest profit.

  • Send the Prompt: Press Enter or click the “Send” button.

  • Review the Output: Gemini will now perform the analysis and should provide an output that matches your request perfectly: a clean, sorted markdown table showing the total profit for each of the four regions.

2.0.4 Part 4: Continuing the Dialogue with Follow-up Questions

A great initial answer is just the start. Now, we apply the three-step dialogue model from Segment 1 to dig deeper.

  • Clarify & Drill Down: The initial output shows that the “West” region is the most profitable. A good analyst would immediately want to know what’s driving that success. Let’s ask a follow-up question to get more detail.
    • Pro Tip: Re-anchoring Your AI: Sometimes, in a long conversation, an AI can “lose context” and forget about the file you uploaded. To prevent this, it’s a best practice to gently remind the AI of your data source in your follow-up prompts.
    • Follow-up Prompt: > That’s a great start. Now, using the attached Superstore.xlsx file, show me the total profit by Sub-Category for the ‘West’ region only and present it as a sorted markdown table.
  • Question & Hypothesize: The AI will now show you that within the West region, “Copiers” and “Binders” are highly profitable. But you might also see that “Tables” are losing money. This leads to a “why” question.
    • Follow-up Prompt: > Interesting. Why are ‘Tables’ so unprofitable in the West region? Compare the average Discount for ‘Tables’ in the West to the average discount for ‘Tables’ in other regions.
  • Challenge & Refine: The AI might give you a table showing that the average discount for ‘Tables’ is around 32% and confidently state that this is the “primary driver.” This is where you, the human analyst, must apply your critical thinking and challenge the AI’s approach by maintaining the focus of your investigation.
    • Follow-up Prompt: > You’ve shown me the impact of discounts, but is that the only factor? Redo the analysis, but this time show me both the average Discount and the average Shipping Cost for ‘Tables’ in the West region compared to other sub-categories in the West region. This will give us a more complete picture.
    • The Analyst’s Role: This final step is the most important. The AI is excellent at finding correlations (the “what”), but your job is to use your business knowledge to question its conclusions and guide it to a more complete analysis (the “so what?”). Never blindly trust an AI’s first conclusion. Use its output as a hypothesis, and then use your own critical judgment to decide what to ask next.

This iterative process of prompting, receiving a hypothesis, and then using your own judgment to challenge and refine the analysis is the core of effective and responsible AI-augmented analysis.

3 Introduction to the Analyst’s Lab - Notebooks

Objective: In the previous segment, you used an AI chatbot to perform a quick, exploratory analysis. That process is excellent for brainstorming and getting initial ideas. However, for a formal project, you need a way to present your work that is clean, professional, and reproducible. This is where notebooks come in. By the end of this segment, you will understand what a notebook is and how to use its basic components.

Tool: We will be using Google Colab, a free, cloud-based notebook environment.

3.0.1 Part 1: What is a Notebook? The Analyst’s Lab Notebook

Think of a Google Colab notebook as a digital lab notebook for a data analyst. It’s a single, interactive document where you can combine everything related to your analysis in one place:

  • Your notes and narrative: Explanations of your goals, methods, and findings.
  • Your live, runnable code: The actual Python code you use to perform the analysis.
  • Your results: The outputs from your code, including tables, statistics, and data visualizations.

This is the professional standard for data analysis because it makes your work transparent and reproducible. Anyone can open your notebook, read your thought process, run your code, and get the exact same results.

Getting Started:

  • Navigate to colab.research.google.com.
  • Sign in with your Google account.
  • An “Open notebook” dialog box will appear. This box allows you to open recent files, upload a notebook, or create a new one. For now, you can simply click the “New notebook” link at the bottom of this box to get started.
  • If you have already closed that box, you can always create a new notebook by going to the File menu in the top-left corner and selecting New notebook.

3.0.2 Part 2: The Two Building Blocks - Code Cells and Text Cells

A notebook is built from two fundamental types of cells. You can add new cells using the “+ Code” and “+ Text” buttons at the top of the page.

1. Code Cells This is where you write and run your Python code.

  • Appearance: A code cell has a light gray background and a “play” button (▶️) to its left.
  • Action: Type a simple line of Python code into the cell, like print("Hello, World!").
  • Execution: Click the play button. The code will run on Google’s servers, and the output (Hello, World!) will appear directly below the cell.

2. Text Cells (Markdown) This is where you write your narrative, add headings, and explain your work. Text cells use a simple formatting language called Markdown.

  • Action: Click the “+ Text” button to add a text cell. You will see a split view: the left side is the editor where you type your Markdown, and the right side shows a live preview of the rendered text.
  • Formatting with Markdown (The Basics):
    • To create a large heading, start a line with a single hashtag (#). Example: # My Analysis Title
    • To create a smaller subheading, use more hashtags. Example: ## Step 1: Data Cleaning
    • To create a bulleted list, start each line with an asterisk (*). Example: * First item
  • Viewing and Editing: When you click out of a text cell, it will show the final, beautifully rendered text. To edit it again, simply double-click on the text, and the split-screen editor will reappear.

3.0.3 Part 3: The Analyst’s Workflow in a Notebook

A professional analysis notebook tells a story. The best practice is to alternate between text and code cells to guide your reader through your work.

  • Start with a Text Cell: Add a text cell at the top and use Markdown to give your analysis a title and a brief introduction explaining your goal.
  • Add a Code Cell: Below your introduction, add a code cell to perform the first step of your analysis (e.g., loading the data).
  • Add another Text Cell: Below the code’s output, add another text cell to explain the results or introduce the next step.

By following this simple pattern, you can create a clean, easy-to-follow report that combines your narrative and your code in a single, powerful document. In the next segment, we will combine everything we’ve learned to demonstrate the full workflow, from AI chatbot to a finished notebook.

4 The Full Workflow - From AI Chatbot to Notebook

Objective: In this segment, we will put everything together. You will see a complete, end-to-end demonstration of the AI-augmented workflow, moving from an initial question in an AI chatbot to a final, reproducible analysis in a notebook. This is the exact workflow you will use to complete your final project.

4.0.1 Part 1: The Exploratory Dialogue (in the AI Chatbot)

Our workflow begins with a conversation. The goal here is not to produce a final report, but to explore the data, test ideas, and generate the initial code.

  • Start in your AI Chatbot (e.g., Google Gemini) with the Superstore.xlsx file uploaded.

  • Use a Powerful Initial Prompt: Let’s use a task that should be familiar from your Module 1 homework. We will ask the AI to calculate the return rate by region.

    Act as a business data analyst. Using the Orders and Returns sheets from the attached Superstore.xlsx file, perform the following steps:

    • Clean the Returns data by removing duplicate Order IDs.

    • Merge the cleaned Returns data with the Orders data to identify which orders were returned.

    • Calculate the return rate for each Region.

    • Present the final return rates in a simple markdown table.

  • Critically Evaluate the AI’s Methodology: The AI will likely give you the correct answer, but it may have made an intelligent assumption without telling you. For example, it might have correctly used the count of unique Order IDs for the total number of sales, rather than the total number of rows (since one order can have multiple rows). A good analyst must make this transparent. This is a perfect time to use a “Challenge & Refine” follow-up prompt.

    • Follow-up Prompt to Verify Methodology: > “This looks correct, but to ensure I understand your work, please explain exactly how you calculated the denominator (the total number of sales) for the return rate. Did you use the total row count from the Orders sheet, or the count of unique Order IDs? Explain why you chose that method.” This step is crucial. It forces the AI to reveal its logic, making your analysis transparent and confirming that the business logic is sound.

4.0.2 Part 2: The Hand-off - From Dialogue to Code

Once your exploratory dialogue has produced a correct and well-understood analysis, it’s time to make it reproducible.

  • Ask for the Code: The final step in your AI dialogue is to ask for the complete, clean code that produced the final result.

    This is perfect. Now, show me the complete, single block of Python code you used to perform this entire analysis, from loading the files to calculating the final return rates based on unique Order IDs.

  • Copy the Code: The AI will generate a block of Python code. Copy this entire block to your clipboard.

4.0.3 Part 3: The Formal Report (in the Notebook)

Now, we move from the exploratory environment of the chatbot to the formal, professional environment of a notebook (e.g., Google Colab).

  • Create a New Notebook: Open Google Colab and create a new notebook. Give it a descriptive name like “Return Rate Analysis”.
  • Start with a Narrative: The first step in a professional report is to explain what you are doing.
    • Add a Text (Markdown) cell at the top.

    • Write a clear title and a brief introduction. For example:

      # Analysis of Return Rates by Region This analysis investigates the product return rates across different sales regions for the Global Superstore. The goal is to identify which region has the highest rate of returns.

  • Upload Your Data to the Notebook: Your notebook needs access to the data file.
    • On the left side of your Colab screen, click the folder icon to open the file browser.
    • Click the “Upload to session storage” button (it looks like a page with an arrow pointing up).
    • Select the Superstore.xlsx file from your computer. You will see it appear in the file browser.
  • Build Your Analysis Step-by-Step:
    • Instead of pasting the entire script into one cell, it is a best practice to break it into logical chunks in separate code cells. This makes your analysis easier to read, document, and debug.
    • Step 1: Imports and Data Loading: In the first code cell, paste only the lines for importing libraries and loading the data. Run it to make sure the data loads correctly.
    • Step 2: Document Your Process: In a new text cell, explain the next step. For example: “Now that the data is loaded, the next step is to clean the Returns data by removing any duplicate Order IDs.”
    • Step 3: Add More Code: In a new code cell, paste the line of code that performs the data cleaning. Run it.
    • Continue this pattern: Continue breaking the AI-generated script into logical steps. After each code cell, you should add a text cell to explain what you did, interpret the results, or introduce the next step in your analysis. This creates a clear, professional narrative.
  • Troubleshooting and Debugging:
    • What if you get an error? This is a normal part of the process! By breaking the code into cells, you know exactly which step failed.
    • The Debugging Workflow: If a cell produces an error, copy both the code from that cell and the full error message. Paste them back into your AI chatbot and ask: “I ran this code and got the following error. Can you explain what went wrong and help me fix it?” This teaches you to use the AI not just for creating code, but for fixing it as well.

Key Takeaway: You have now successfully completed the full AI-augmented workflow. You used the AI chatbot for its speed and brainstorming capabilities, but you used your own critical thinking to verify its methods. You then used the notebook to create a final, documented, and reproducible report, applying debugging skills to ensure the code works perfectly. This process—Dialogue → Verification → Code → Debug → Documented Notebook—is a powerful and professional way to conduct data analysis!


5 Appendix: Data and Course Resources

5.1 Sample Data

The tutorial uses the Superstore dataset, a sample dataset commonly used for learning data analysis:

📊 Download Superstore.xlsx - Sample retail dataset for practice

Citation: Tableau Software. (2021). Sample - Superstore.xls. Retrieved from https://www.tableau.com

5.2 Data Dictionary

Complete field descriptions for the Superstore dataset used in this tutorial.
Field Name Type Description
Order ID Categorical Unique identifier for each customer order (e.g., CA-2016-152156)
Order Date Categorical Calendar date the order was placed
Ship Mode Categorical Shipping method (e.g., First Class, Standard Class)
Customer ID Categorical Unique ID for each customer
Customer Name Categorical Full name of the customer
Segment Categorical Market segment: Consumer, Corporate, or Home Office
City Categorical City where the order was delivered
State Categorical U.S. state of delivery
Region Categorical One of four U.S. regions: East, West, Central, South
Category Categorical Main product category: Furniture, Office Supplies, Technology
Sub-Category Categorical More specific product type (e.g., Binders, Phones)
Product Name Categorical Full name of the product
Sales Numerical (Continuous) Total sales amount for the line item
Quantity Numerical (Continuous) Number of units sold
Discount Numerical (Continuous) Discount applied to the line item (0 to 1)
Profit Numerical (Continuous) Profit earned on the line item (can be negative)

Dr. Jiang Li | Franklin University

📧 jiang.li2@franklin.edu | 📅 Book Meeting

© 2025 July | Powered by Quarto