You are on page 1of 88

FOR DATA ANALYTICS

*Copyright Maven Analytics, LLC


COURSE OUTLINE

Explore how AI is changing the way data analysts work, and


1 Why Analysts Need to Use AI why leveraging these tools is critical to stay competitive

Introduce the AI landscape and the role of large language


2 Intro to AI, LLMs & GPTs models and generative pre-trained transformers like ChatGPT

Review best practices for creating clear and effective prompts


3 Prompt Engineering Tips when working with tools like ChatGPT or Bard

4 Common Use Cases

Excel Google Sheets Power BI MySQL Python

*Copyright Maven Analytics, LLC


MEET YOUR INSTRUCTORS

Chris is an EdTech entrepreneur and best-selling instructor.


As Founder and Chief Product Officer at Maven Analytics, his
work has been featured by USA Today, Business Insider,
Entrepreneur and the New York Times, reaching more than
1,000,000 students around the world.

Certified Excel & Power BI Expert


Founder & Lead Instructor

*Copyright Maven Analytics, LLC


MEET YOUR INSTRUCTORS

John brings over a decade of business intelligence experience


to the Maven team, having worked with companies ranging
from Fortune 500 to early-stage startups.
As a MySQL expert, he has played leadership roles across
analytics, marketing, SaaS and product teams.

15+ Years in Applied Analytics


Lead MySQL Instructor

*Copyright Maven Analytics, LLC


MEET YOUR INSTRUCTORS

Chris is a Python expert and seasoned Data Scientist, having


held senior-level roles at large insurance firms and financial
service companies.
He earned a Masters at NC State's Institute for Advanced
Analytics, where he founded the IAA Python Programming club.

Python Expert & Lead Instructor


Certified Statistical Business Analyst

*Copyright Maven Analytics, LLC


MEET YOUR INSTRUCTORS

Enrique is a certified Microsoft Excel Expert and top-rated


instructor with a background in data analysis, visualization and
dashboard design.
He has produced advanced Excel and test prep courses, along
with adaptations for Spanish-speaking learners.

Certified Excel Expert


Excel & Data Viz Instructor

*Copyright Maven Analytics, LLC


MEET YOUR INSTRUCTORS

Aaron is a professional analytics consultant and Microsoft


Power BI expert, with 10+ years in BI and marketing analytics.
He’s an instructor, coach and mentor for aspiring analysts, and
has deep experience helping companies develop and
implement full-stack business intelligence solutions.

Microsoft Certified Data Analyst


Lead Power BI Instructor

*Copyright Maven Analytics, LLC


SETTING EXPECTATIONS

This is an overview on how data professionals can use AI tools


• We’ll introduce the AI landscape and tools like ChatGPT, and review practical use cases for data analysts,
but will not dive deeply into how these models work or give an exhaustive list of everything they can do

We’ll be using free AI tools for the course demos


• We’ll quickly touch on paid options and alternative tools, but the majority of what you see in this course will
be shown using the free versions of ChatGPT and/or Google Bard

AI is a rapidly evolving field, and these tools will change quickly


• AI technology is moving FAST, which means that existing products will change, and new vendors and tools
will emerge, but the core concepts and best practices you learn in this course will remain relevant

This course is designed be modular to fit your needs


• The first half of the course is for everyone, but the second half is structured so that you can focus specifically
on the tools you use as an analyst – feel free to skip over the tool sections that don’t apply to you!

*Copyright Maven Analytics, LLC


*Copyright Maven Analytics, LLC
WHY YOU NEED TO USE AI TOOLS

THE WORLD IS
Technology like ChatGPT, Google Bard, and other Artificial Intelligence tools allow you to
complete tasks that used to take hours in a matter of minutes, making it a total game changer

Reasons you should learn to use AI tools:


ü Improve your performance & efficiency
ü Automate routine, low-value tasks
ü Spend more time on the higher value activities
ü Use AI as an easy way to check your work
ü Leverage it for learning and answering quick questions
ü Stay on the cutting edge and competitive in your field

*Copyright Maven Analytics, LLC


ARE DATA ANALYST JOBS AT RISK?

AI WILL
Fears of analysts losing jobs to AI are overblown; companies will always need human talent and
intuition, but the skills required to be an effective analyst will shift substantially

We call this the “Analytics Trifecta”, because it represents the


three core skills that separate a good analyst from a great one
These are uniquely
This is where AI “human” skills Since AI can fill many technical gaps, analysts with exceptional
really adds value
strategic thinking and communication skills will become more
valuable than ever to organizations
Combine those “human” skills with a strong technical
TECHNICAL foundation enhanced by AI, and you’ll be unstoppable 💪
PROFICIENCY

*Copyright Maven Analytics, LLC


YOU NEED AI TO STAY COMPETITIVE

IF YOU DON’T USE AI


Imagine being a data analyst today without learning spreadsheets or using the internet. We’ll
likely be saying the same thing about ChatGPT and other AI tools in the near future.

750M+ 5B+ 1B+


users worldwide users worldwide users worldwide

The key to an enduring, successful career in Data Analytics is to build a strong foundational skill
set, and keep it sharp by embracing and adapting to modern technology

*Copyright Maven Analytics, LLC


COMMON ANALYTICS USE CASES

THIS IS WHERE
While there are many potential ways that data professionals can leverage AI, these are a few of
the most common and powerful use cases we’ve explored:

Generating code Explaining technical Troubleshooting or Commenting Optimizing queries


or formulas concepts debugging code or formulas

Generating step-by- Providing data Automating Researching Generating


step tutorials visualization tips manual tasks technical topics data samples

*Copyright Maven Analytics, LLC


*Copyright Maven Analytics, LLC
THE AI LANDSCAPE

ARTIFICAL INTELLIGENCE “Weak” vs. “Strong” Artificial Intelligence


Machines and computer systems that mimic
functions associated with human intelligence
like decision making, image recognition, etc.
Weak AI (current state)
• Can only perform specialized tasks
MACHINE LEARNING • For example, GPT-4 could tell you how to drive a car,
Statistical models that help computers learn
but couldn’t use that knowledge to drive a car itself
with minimal human instruction, and get more
accurate when exposed to more data
Strong AI (Artificial General Intelligence)
• Can learn and perform any task that a human can do
• Its development is still on the horizon
DEEP LEARNING
Complex algorithms designed to
mimic the human brain and
learn almost exclusively without While Deep Learning has its foundations in Statistics, it focuses is
human intervention solely on producing accurate model outputs (not understanding
Large language models (LLMs) the underlying data or relationships)
fall in this category
These models are often called “black boxes” since they can pick up
nuances in the data that humans can’t understand or detect

*Copyright Maven Analytics, LLC


GENERATIVE AI & LLMs

Generative AI systems are deep learning models capable of generating original text, images and
other types of media in response to user prompts
• Large Language Models (LLMs) are generative AI models focused on producing text outputs specifically
• Other generative AI models include DALL-E and Midjourney, which are used to generate images

A “simple” language model: How does the model fill in the blank?
• The model doesn’t know that “Paris” is the correct response, but suggests
The capital of France is the answer it thinks is most probable in the given context
___
• Put simply, it compared “Paris” with thousands of words and determined
The capital of France is Paris. that it had the strongest relationship with words like “capital” and “France”

• This may seem easy, but remember that the word “capital” has multiple
meanings, that France has had other capitals, and that the blank could also
be things like “beautiful”, “a popular tourist destination”, etc.

*Copyright Maven Analytics, LLC


GENERATIVE AI & LLMs

Generative AI systems are deep learning models capable of generating original text, images and
other types of media in response to user prompts
• Large Language Models (LLMs) are generative AI models focused on producing text outputs specifically
• Other generative AI models include DALL-E and Midjourney, which are used to generate images

A large language model: How does the model answer the question?
1. It looks at millions of documents for similar questions and related
When did Paris become
statements like “in 508 A.D., Paris became the capital of France”
the capital of France?
2. It is then associates the prompt with these documents, and does its best
to mimic the language from the responses
Paris became the capital of
France in the 6th century. 3. Since it has an element of randomness to account for its uncertainty, if
you ask it again it will likely tell you something similar but not identical

Large language models like ChatGPT are COLOSSAL achievements in machine learning that model the “shape” of language

*Copyright Maven Analytics, LLC


GENERATIVE PRE-TRAINED TRANSFORMERS

Generative Pre-Trained Transformers (GPTs) are a type of large language model trained on
massive text datasets, and are designed to generate outputs that mimic human-written text

The model generates new and The model was already trained A type of deep learning model
original natural language text, on a large dataset before that can process sequential
instead of copying and pasting being fine-tuned to perform inputs and differentiate the
existing data specific tasks importance of individual parts
(also known as self-attention)

LLMs like ChatGPT are among the most sophisticated deep learning models ever built; GPT-4, which powers premium
versions of ChatGPT, has over 1 TRILLION parameters, cost over $100 million dollars, and took 11 months to train

*Copyright Maven Analytics, LLC


A BRIEF HISTORY OF AI

AI tools like ChatGPT became widely popular in late 2022, but owe their success to more than
60 years of research and development in artificial intelligence systems
GPT4
GPT3
ng
u bli
do
nth
MODEL PARAMETERS

o GPT2
4-m
GPT1

bling
r dou
2-yea

“Modern Era” of AI

The term “Artificial Intelligence” Researchers find major flaws The first neural network Transformer Layers are
Deep Blue beats
is used for the first time in the Perceptron algorithm with deep learning introduced in Neural Nets
chess champion
capabilities is developed
Gary Kasparov
The first neural network Multi-layer Perceptrons & Open AI founded, AlphaGo
algorithm is implemented Backpropagation implemented IBM Watson beats beats world champions at Go
in the same algorithm humans at Jeopardy!
ELIZA, the first chatbot, Siri & Alexa
is created at MIT Neural networks outperform other AlexNet sets a standard are launched
solutions in document recognition for image recognition
*Neural Net breakthroughs
*AI achievements *Copyright Maven Analytics, LLC
PATH TO 1 MILLION

The rate of adoption for modern AI tools is unprecedented; ChatGPT became the fastest-
growing online product in history, reaching 1 million users in only 5 days

3.5 YEARS

2 YEARS

10 MONTHS

2.5 MONTHS

5 DAYS

*Copyright Maven Analytics, LLC


COMMON AI TOOLS

Rapid advancements in AI technology and the success of ChatGPT have led to an unprecedented
explosion of new apps, services, and players in the field

Text Video

Image Code

Speech 3D Music

*Copyright Maven Analytics, LLC


CHATGPT & BARD

In this course, we’ll be focusing on exploring two of the most popular GPT tools on the market:
ChatGPT (from OpenAI) and Bard (from Google)
• ChatGPT made headlines first, but Google Bard emerged as a strong competitor in early 2023

These tools each have unique strengths, but are very similar in terms of benefits & limitations for data professionals

*Copyright Maven Analytics, LLC


WARNING: COMMON PITFALLS

LLMs are known to “hallucinate” facts with total confidence


• Remember that YOU are ultimately responsible for verifying the accuracy of model outputs

Solutions provided may be suboptimal or entirely incorrect


• AI tools don’t guarantee accuracy, and may provide incorrect or inefficient solutions

These tools are broad and often lack specific domain knowledge
• LLMs may not understand specific business context or the “why” behind the responses they produce

LLMs are NOT capable of common sense or human judgement


• Models need specific, objective inputs, and may miss critical context that may seem obvious to humans

*Copyright Maven Analytics, LLC


ACCESSING CHATGPT

You can access ChatGPT for free at chat.openai.com

• Open AI currently allows anyone to sign up and use


ChatGPT for free (note that there is a paid version as well)

• You can create an account using an email address, or by


connecting an existing Microsoft or Google account

• Read more information about ChatGPT on the OpenAI


website: https://openai.com/blog/chatgpt

*Copyright Maven Analytics, LLC


ACCESSING GOOGLE BARD

You can access Google Bard for free at bard.google.com

• Google made Bard available for free in May


2023 (available in most countries)

• You can sign up for Bard using an existing


Google email or creating a new account

• Read more information about Bard here:


https://bard.google.com/faq

*Copyright Maven Analytics, LLC


*Copyright Maven Analytics, LLC
PROMPT ENGINEERING 101

Prompts are questions or instructions that serve as the input for models like ChatGPT
• Prompt engineering is the practice of constructing prompts to generate effective and accurate responses

This is the
prompt Tips & Best Practices:

ü Be as clear and specific as possible


This is the ü Provide context and examples
response
ü Establish roles for specific use cases
ü Set the tone or level of complexity
ü Understand model limitations

PRO TIP: You likely won’t nail the “perfect”


prompt right away; make sure to refine and iterate
based on quality of the responses

*Copyright Maven Analytics, LLC


TIP: BE CLEAR & SPECIFIC

vs
Can you give me an Excel formula to calculate year over year
How do you calculate year over year growth?
growth?
Data for this year lives in cells C2:C100, and data for last
year lives in cells B2:100.

PRO TIP: When generating code, include details like


variable names, data types, cell ranges, etc.

*Copyright Maven Analytics, LLC


TIP: PROVIDE CONTEXT

vs
I’m a Data Analyst working on supply chain analytics for a
What are common supply chain KPIs?
multinational distribution company. What KPIs should I be
analyzing? For each metric, please include a formula
showing how it is calculated.
For example, we would calculate conversion rate as follows:
Conversion rate = website orders / website sessions

*Copyright Maven Analytics, LLC


TIP: ESTABLISH ROLES

vs
I'm a new Data Analyst for a retail business, and I've been
What’s the best way to clean data?
tasked with cleaning and preparing a raw dataset for analysis.
Please play the role of a Data QA Engineer and provide a
step-by-step plan for me to follow.

*Copyright Maven Analytics, LLC


TIP: SET THE TONE

vs
Explain regression analysis in two sentences to a C-Level
Explain regression analysis
executive at a marketing agency

PRO TIP: Use prompts like “explain it to me as if you


were speaking to a child” to adjust the tone and
complexity of the response

*Copyright Maven Analytics, LLC


*Copyright Maven Analytics, LLC
CHATGPT FOR EXCEL

In this section we’ll explore common use cases for ChatGPT + Excel, including
generating formulas, troubleshooting errors, explaining complex topics, and more

TOPICS WE’LL COVER: GOALS FOR THIS SECTION:


• Learn how to use ChatGPT as a personal tutor, to
explain complex Excel formulas or concepts
• Use ChatGPT to generate Excel formulas based on
text descriptions or sample data
• Generate DAX, M or VBA code for data modeling,
analysis or automation
• Troubleshoot broken formulas or code
• Provide step-by-step plans for data prep, QA or
exploratory analysis

*Copyright Maven Analytics, LLC


Please explain how the XLOOKUP function works in Excel. Describe it like you
were speaking to a child, and please provide sample data and example formulas.

ü Be as clear and specific as possible

ü Use prompts to set the desired tone and


complexity of the response

ü Ask for sample data, formula syntax,


common use cases, etc.

ü Iterate and use follow-up prompts until you


get the focus and level of detail you need
I’m managing my grocery list in Excel, with items in cells B4:B50. Please write
a dynamic array to count the number of unique text values in the list.

ü Include details like table names and cell


references to generate formulas that don’t
require additional modification

ü Provide additional context or background


information whenever possible

ü Regenerate the responses to test and


compare options (ChatGPT may not
provide the optimal solution)
I have a table in Excel’s data model named “Movies”, containing fields for
Genre, Rating, and IMDb Score. Can you please create a DAX measure to
calculate the average IMDb Score for PG-13 rated action movies?

ü Include details like table and field names


to generate formulas that don’t require
additional modification

ü Provide additional context or background


information whenever possible

ü If needed, provide a sample and ask


ChatGPT to modify it rather than
generating new code from scratch
Can you please modify the following M code to add a step calculating average
IMDb rating grouped by genre and rating? [insert code sample]

ü Include details like table and field names


to generate formulas that don’t require
additional modification

ü Provide additional context or background


information whenever possible

ü If needed, provide a sample and ask


ChatGPT to modify it rather than
generating new code from scratch
I have an Excel worksheet named "Top Movies" containing a table with the
following fields: Titles, Genre, Country, Rating, IMDb Score, and Gross Revenue.
Please generate a VBA script to autofit all rows and columns in the sheet,
highlight every other row, and save it to my desktop as a PDF. Please provide
step-by-step instructions.

ü Be as clear and specific as possible

ü Provide details like tables, field names and


file paths to generate code that doesn’t
require additional modification

ü Ask for step-by-step instructions or code


explanations, especially if you aren’t
familiar with Visual Basic
Please write an Excel function to extract the username (text before the “@” symbol)
from the E-mail column, based on the data sample below [insert data sample]

ü Provide a sufficient, representative data


sample (ideally in csv format)

ü Include details like table names and cell


references to generate formulas that don’t
require additional modification

ü Regenerate the responses to test and


compare options (ChatGPT may not
provide the optimal solution)
I’m analyzing a sample of wine data and would like to understand the distribution
of wines by price point. What would be the best way to visualize this in Excel?

ü Provide details about the dataset you’re


working with and desired output

ü Include key words and phrases to help


ChatGPT identify the most appropriate
type of visual (distribution, relationship,
comparison, composition, trend, etc.)

ü Use follow-up prompts to gather additional


details about how to structure the data and
create the visual
I’m using the Excel formula below to count the number of words in cell D2,
but it's returning a #VALUE! error in Excel. Can you tell me how to fix it?
=LEN(TRIM(D2))-LEN(SUBSTITUTE(TRIM(D2)," ","")+1)

ü Include the full formula in the prompt,


along with any additional context

ü Provide specific details like cell references


and error types

ü Regenerate the responses to test and


compare options (ChatGPT may not
immediately identify the error or provide
the optimal solution)
I have an Excel table containing the following fields: Order ID, Product, Quantity,
Retail Price, Revenue and Order Size.
I need to create a PivotTable showing the average revenue for each order size,
formatted as currency (USD). Please provide clear, step-by-step instructions for
creating the PivotTable using Excel for Office 365 on a PC.

ü Be as clear and specific as possible

ü Specify which version of Excel you’re using


and what the desired output looks like

ü Regenerate the responses to compare


options (ChatGPT may not provide optimal
solutions, especially for more complex or
open-ended use cases)
I just exported a raw csv file containing web traffic data. Could you please act
like a Data Quality Assurance Engineer, and provide a step-by-step plan to help
me QA and prepare my data for analysis?

ü Provide context about your professional


role, the type of data you’re working with,
and your key objectives

ü Specify the role you’d like ChatGPT to play


to set the tone and complexity of the
response

ü Iterate and use follow-up prompts to


continue the conversation
I'm a recently hired Data Analyst for an HR firm, looking for sample data that I
can use for practice. Please generate a sample dataset in CSV format
containing common fields that HR Analysts typically encounter on the job.

Please also modify the sample to include some common data QA issues and
describe what specific changes you made.

ü Provide context about your role, industry,


and objectives

ü Specify the type of data, number of


records, and format you’re looking for
(best for small samples in CSV format)

ü Ask ChatGPT to provide a data dictionary


or summary of the sample dataset
*Copyright Maven Analytics, LLC
CHATGPT FOR GOOGLE SHEETS

In this section we’ll explore common use cases for ChatGPT + Google Sheets, including
writing & explaining formulas, fixing errors, applying advanced techniques, and more

TOPICS WE’LL COVER: GOALS FOR THIS SECTION:


• Learn how to use ChatGPT to explain, generate,
and troubleshoot Google Sheets formulas

• Use ChatGPT to apply advanced formula-based


conditional formatting rules
• Adapt Excel-specific tools like data bars and
sparkline visuals to Google Sheet’s functionality
• Leverage Google Sheet’s REGEX functions by using
ChatGPT to write regular expression patterns
• Automate tasks by coding Apps Scripts

*Copyright Maven Analytics, LLC


Please explain how the following QUERY function works in Google Sheets. I
know it returns the top 5 selling products for the month, but I don’t know how.
[insert code sample]

ü Be as clear and specific as possible

ü Provide context into what the formula


returns, or is expected to return

ü Include a sample of the source data


and its location on the sheet

ü Iterate and use follow-up prompts


until you get the detail you need
Can you help me find what’s wrong with this formula in Google Sheets?
=IF(F2=B2, "None", IF(OR(F2>E2, F2>AVERAGE(B2:E2), Increase, Decrease)))

ü Be as clear and specific as possible

ü Specify the error type (#N/A,


#NAME?, etc.) and full error message

ü Provide context into what the formula


is expected to return

ü Iterate and use follow-up prompts


until you get the output you need
Can you help me write a Google Sheets formula that returns the full month name
(January, February, etc.) from a date in cell B2?

ü Be as clear and specific as possible

ü Provide context into what the formula


is expected to return

ü Include details like table names and


cell references to generate formulas
that don’t require additional
modification

ü Iterate and use follow-up prompts


until you get the output you need
I use Google Sheets as a task tracking tool and would like the entire row (A:E) to be
highlighted green whenever the checkbox in column E is checked. Can you help?

ü Be as clear and specific as possible

ü Include a sample of the source data


and its location on the sheet

ü Include details like column and cell


references to generate formulas that
don’t require additional modification

ü Iterate and use follow-up prompts


until you get the desired behavior
How can I create an Excel “sparkline” in Google Sheets? I have sales values in
columns B2:H2 and want to show a line chart with the trend inside cell J2.

ü Be as clear and specific as possible

ü Specify the Excel tool & functionality


you’re trying to replicate

ü Remind ChatGPT of the limitations of


Google Sheets

ü Iterate and use follow-up prompts


until you get the desired behavior
Can you help me write a Regex pattern that checks if an email address is valid?

ü Be as clear and specific as possible

ü Specify the pattern you’re trying to


match or extract

ü Provide examples of the source data


and the expected result

ü Iterate and use follow-up prompts


until you get the output you need
Can you help me write an Apps Script in Google Sheets that wraps any formulas
in the selected cells in an IFERROR([formula], “”) statement?

ü Be as clear and specific as possible

ü Specify the exact task you’d like the


Apps Script to automate

ü Provide context into the scenarios in


which you’d like to use the Apps Script

ü Iterate and use follow-up prompts


until you get the desired behavior
*Copyright Maven Analytics, LLC
CHATGPT FOR POWER BI

In this section we’ll explore common use cases for ChatGPT + Power BI, including
writing and troubleshooting DAX measures, building data dictionaries, and more

TOPICS WE’LL COVER: GOALS FOR THIS SECTION:


• Learn how to use ChatGPT as a personal tutor to
get started with Power BI & explain core concepts

• Explain and document M & DAX code and build


data dictionaries based on table structures
• Use ChatGPT to generate Power BI formulas based
on text descriptions or sample data
• Use ChatGPT to help troubleshoot errors with DAX
code and suggest solutions
• Generate guidance to properly select and build
visualizations and dashboards

*Copyright Maven Analytics, LLC


I’m new to Power BI. Can you give me a step-by-step plan to get started?

ü Ask a simple question first, then use


additional prompts to dive deeper into
specific areas

ü Ask for examples, common use cases,


helpful resources, etc.

ü Iterate and use follow-up prompts


until you get the focus or starting
point you need
I've just been hired as a data analyst for Maven Fuzzy Factory, and I need to
import data from their MySQL database into Power BI. I have access to MySQL,
but I'm not sure how to connect. Can you help me?

ü Provide context, and be as clear and


specific as possible

ü Ask for step-by-step instructions or


guidelines

ü Iterate and use follow-up prompts


until you get the focus and level of
detail you need
Can you create a 4-column data dictionary that includes the variable name, data
type, description, and an example value, based on the data below?
[insert data sample]

ü Be as clear and specific as possible

ü Outline the desired output, including


column names and details

ü Provide a sufficient, representative


sample of data in CSV format

ü Iterate and use follow-up prompts as


needed
I’m working with the Power Query M code below. Can you add comments, format
the code, and update my applied step names to make them easier to understand?
[insert code sample]

ü Be as clear and specific as possible

ü Provide a code sample along with


detailed instructions and a description
of the desired output

ü Iterate and use follow-up prompts


until you get output you need
I’m an entry-level Data Analyst working with Power BI. Can you please
summarize the difference between measures vs calculated columns?

ü Set the content, and focus on one


specific topic at a time

ü Use prompts to set the tone and


complexity of the response

ü Ask for clarifying details if a response


doesn’t seem accurate

ü Use follow-up questions or prompts to


dive deeper into specific topics
I’m a relatively new Power BI user. Can you provide an example of a calculated
column and a measure, and describe when to use each?

ü Provide clear context, and use


prompts to set the tone and
complexity of the response

ü Ask for sample data, formula examples,


common use cases, etc.

ü Iterate and use follow-up prompts


until you get output you need
Can you explain what this DAX code is doing, and add in-line comments so that
other users can understand what’s happening? [insert code sample]

ü Provide a clean code sample along


with a description of the desired
output

ü Ask for a written explanation along


with code comments to describe the
purpose of each step

ü Iterate and use follow-up prompts


until you get output you need
Could you help me write a DAX measure in Power BI to calculate total revenue,
and another to calculate year-over-year revenue change? I have a ‘Sales’ table
containing order-level transactions, and a ‘Dates’ table containing a list of dates.

ü Provide details like table and column


names to generate code that doesn’t
require additional modification

ü Iterate and use follow-up prompts to


modify measures or create new ones
based on existing context

ü Iterate and use follow-up prompts


until you get output you need
Can you help me troubleshoot the following DAX measure?
Total Revenue = SUMX(‘Sales’, ‘Sales’[Order Quantity] * ’Products’[Price])
I'm trying to multiply the order quantity in the ‘Sales’ table by the related price in
the ‘Products’ table, but the error says that a single value cannot be determined.

ü Be as clear and specific as possible

ü Provide table and column names,


along with specific error message
details to help ChatGPT diagnose

ü Iterate and use follow-up prompts


until you get output you need (the
initial solution may be incorrect!)
I’m using Power BI and need to show total customer orders trended over the
past 3 years. Can you suggest a visual and describe how to build it?

ü Provide details about the dataset you’re


working with and desired output

ü Include key words and phrases to help


ChatGPT identify the most appropriate
type of visual (distribution, relationship,
comparison, composition, trend, etc.)

ü Use follow-up prompts to gather


additional details about how to
structure the data and create the visual
I'm a business analyst and need to create a dashboard for upper management to
visualize KPIs and monitor the company's overall performance. Can you tell me
how to build a dashboard that will provide a comprehensive overview of critical
metrics to aid in strategic decision making and drive business growth?

ü Provide clear context and describe the


desired output

ü Include specific details about the


dashboard’s purpose, intended
audience, level of detail, etc.

ü Iterate and use follow-up prompts


until you get the focus and level of
detail you need
*Copyright Maven Analytics, LLC
CHATGPT FOR SQL

In this section we’ll explore common use cases for ChatGPT + SQL, including
generating queries, commenting code, debugging errors, and more

TOPICS WE’LL COVER: GOALS FOR THIS SECTION:


• Learn how to use AI as a personal coach, to explain
complex SQL code or concepts
• Use AI tools to generate SQL queries from scratch
by describing your desired output
• Ask AI tools to help you debug errors in your SQL
queries and rewrite the code without errors
• Comment and optimize complex SQL queries with
the help of AI tools

*Copyright Maven Analytics, LLC


You’ll be acting as a SQL expert. You’ll be coaching me, as a junior coworker who is
learning SQL and needs help. Can you explain the difference between a LEFT JOIN
and an INNER JOIN in SQL?

ü Be as clear and specific as possible

ü Use roles to add context and set the


tone and complexity of the response

ü Ask for sample data, formula examples,


common use cases, etc.

ü Iterate and use follow-up prompts to


dive deeper into specific topics
You’ll be acting as a Senior Analyst who is an expert in SQL. You’ll be helping me, a
junior analyst on the team, understand SQL queries that we’ll use together on the job.
Can you please explain the following query to me? [insert code sample]

ü Be as clear and specific as possible

ü Use roles to add context and set the


tone and complexity of the response

ü Provide code samples and ask for


summaries or line-by-line explanations

ü Iterate and use follow-up prompts


until you get the focus and level of
detail you need
You’ll be acting as a Senior Analyst who is an expert in SQL. You’ll be helping me, a
junior analyst on the team, understand SQL queries that we’ll use together on the job.
Could you add comments to this query to make it easy for other analysts to understand?
[insert code sample]

ü Be as clear and specific as possible,


and clearly describe the desired output

ü Use roles to add context and set the


tone and complexity of the response

ü Iterate and use follow-up prompts


until you get the output you need
You’ll be acting as a Senior Analyst who is an expert in SQL. You’ll be helping me, a junior
analyst on the team, troubleshoot an error. The error I’m seeing is below, and you can see
the query here. Can you correct the error and explain what you did? [insert code sample]

ü Be as clear and specific as possible,


and provide specific code samples and
error details

ü Use roles to add context and set the


tone and complexity of the response

ü Ask for corrected code, along with a


summary of what was changed

ü Iterate and use follow-up prompts


until you get output you need (the
initial solution may be incorrect!)
You’ll be acting as a SQL expert and helping me, a non-expert, create some queries to pull
data from our database. Based on the descriptions below, can you create a query to pull a
list of the most valuable students in terms of how much revenue they have generated?
[insert table descriptions]

ü Be as clear and specific as possible,


and include context around table
names, descriptions, etc.

ü Use roles to add context and set the


tone and complexity of the response

ü Iterate and use follow-up prompts


until you get output you need (the
initial solution may be incorrect!)
You’ll be acting as a SQL expert, and will be helping me, a junior member on the team,
understand how to optimize my SQL query to improve its performance.
Can you please write the query below in a more efficient way, and explain to me the
changes you made like I’m someone who is new to SQL? [insert code sample]

ü Be as clear and specific as possible

ü Use roles to add context and set the


tone and complexity of the response

ü Ask for optimized code along with a


clear summary of the changes made

ü Iterate and use follow-up prompts


until you get the output you need
*Copyright Maven Analytics, LLC
CHATGPT FOR PYTHON

In this section we’ll explore common use cases for ChatGPT + Python, including
explaining code, troubleshooting errors, visualizing data, and more

TOPICS WE’LL COVER: GOALS FOR THIS SECTION:


• Learn how to use AI as a personal coach to explain,
debug, and optimize Python code
• Use AI tools to generate Python code for data
analysis and visualization
• Leverage AI tools to help research and compare
Python libraries
• Use AI to assist with Web Scraping and Machine
Learning projects

*Copyright Maven Analytics, LLC


Can you explain what the following code is doing at a high level? Make sure to
include a sample output as well. [insert code sample]

ü Be as clear and specific as possible

ü Use prompts to add context and set


the tone and complexity of the
response

ü Provide code samples and ask for


summaries, sample outputs, or line-by-
line explanations

ü Iterate and use follow-up prompts


until you get the focus and level of
detail you need
Can add detailed comments describing what the following Python code is doing,
so that other analysts can easily understand it? [insert code sample]

ü Be as clear and specific as possible,


and clearly describe the desired output

ü Use roles to add context and set the


tone and complexity of the response

ü Iterate and use follow-up prompts


until you get the output you need
Can you please describe the following Python code, optimize it for efficiency,
and summarize the changes you made? [insert code sample]

ü Be as clear and specific as possible

ü Ask for optimized code along with a


clear summary of the changes made

ü Iterate and use follow-up prompts


until you get the output you need
When I run the following code, I get the error: “TypeError: pivot_table() got an
unexpected keyword argument ‘value’. Why am I getting an error?
[insert code sample]

ü Be as clear and specific as possible,


and provide specific code samples and
error details

ü Use roles to add context and set the


tone and complexity of the response

ü Ask for corrected code, along with a


summary of what was changed

ü Iterate and use follow-up prompts


until you get output you need (the
initial solution may be incorrect!)
I have a retail sales data set stored in a file called “retail.csv”, containing the
following columns: date, store_nbr, family, and sales. Can you write Python code
that calculates the total sales by month for each store and product family?

ü Be as clear and specific as possible,


and include context around tables,
columns, data types, etc.

ü Use roles to add context and set the


tone and complexity of the response

ü Iterate and use follow-up prompts


until you get output you need (the
initial solution may be incorrect!)
I have a csv file called “retail.csv” that contains information on daily retail sales. It
contains the columns date, family, and sales, among others. Can you write Python
code that plots the top 10 product families by total sales, in descending order?

ü Be as clear and specific as possible,


and describe the desired visual output

ü Use roles to add context and set the


tone and complexity of the response

ü Iterate and use follow-up prompts


until you get output you need (the
initial solution may be incorrect!)
Can you compare and contrast the matplotlib, seaborn, and plotly express
libraries in Python, as if you were describing them to a new Python user?

ü Be as clear and specific as possible,


and describe the desired output

ü Use roles to add context and set the


tone and complexity of the response

ü Iterate and use follow-up prompts to


drill deeper into specific topics
Can you write Python code to scrape the median household income by US
state from Wikipedia and store them in a Pandas DataFrame?

ü Be as clear and specific as possible,


and describe the desired output

ü Include context around the Python


libraries you’d like to use, how you’d
like to store the data, etc.

ü Use roles to add context and set the


tone and complexity of the response

ü Iterate and use follow-up prompts


until you get output you need (the
initial solution may be incorrect!)
Can you explain what the linear regression model coefficients in the output
below mean in relation to the target variable (health insurance price)? Describe it
as if you were speaking to a non-technical executive. [insert model output]

ü Be as clear and specific as possible,


and describe the desired output

ü Use roles to add context and set the


tone and complexity of the response

ü Iterate and use follow-up prompts to


drill deeper into specific topics
*Copyright Maven Analytics, LLC
KEY TAKEAWAYS

Tools like ChatGPT will change the way data professionals work
• Analysts will need to adapt and evolve to new technology to stay competitive in the age of AI

AI isn’t perfect, and may “hallucinate” or provide incorrect responses


• Remember that YOU are ultimately responsible for verifying the accuracy of the model output

Prompt engineering can dramatically improve response quality


• Be specific, provide meaningful context, and iterate to produce accurate and relevant responses

AI tools can be applied to many types of analytics use cases


• Tools like ChatGPT can help troubleshoot or generate code, automate tasks, and much more

*Copyright Maven Analytics, LLC


NEXT STEPS

In terms of AI revolutionizing the way analysts work, ChatGPT and Bard are only the beginning
• Just like the internet at the turn of the century, AI tools will fundamentally change the future of work

Our Advice:

ü Stay up to date with new tools & technology


• The AI industry is evolving quickly, so make sure to follow the latest news and developments from trusted
companies and thought leaders in the space

ü Be curious, but skeptical


• While we expect some amazing new AI developments in the coming years, we also expect to see some
unrealistic promises from companies trying to capitalize on the hype

ü Build a well-rounded skill set


• As tools like ChatGPT begin to automate more complex technical tasks, focus on developing your uniquely
“human” skills like problem solving, strategic thinking, communication and business acumen

*Copyright Maven Analytics, LLC

You might also like