4 Data Analytics tasks that ChatGPT can do much faster & better

Love Spreadsheets
4 min readJul 19, 2023

In this article, I will show you how to use ChatGPT to do 4 common data analytics tasks. You can use ChatGPT at this link: https://chat.openai.com/chat

1. Extracting details from text

ChatGPT can take text data like addresses, names, product reviews, and extract details from it.

For example, let’s see how to extract street names from a list of 5 addresses. I can write the following prompt in ChatGPT

Tell me the street names in all these addresses and parse them in a table for output: 
20 W 34th St., New York, NY 10001, United States
Florida 1065, C1005 CABA, Argentina
Tytusa Chałubińskiego 8, 00-613 Warszawa, Poland
1 Sheikh Mohammed bin Rashid Boulevard, Dubai, UAE
China, Shanghai, Pudong, 陆家嘴 Lujiazui, 银城中路501号 邮政编码: 200120

The parse them in a table for output part of the prompt is important so the output can be easily copied and pasted

And immediately ChatGPT produces the following output

It even gets the street name from the address in China AND translates it into English!

2. Categorizing open ended text into keywords

ChatGPT can easily categorize open ended text into relevant keywords.

Let’s say we have the following review left on our eCommerce site and we want to extract the location of the review, the sentiment (positive, negative, neutral), and key features of the product.

Review 1

Location: New York, USA

I’m so impressed with this computer! The processing speed is lightning fast and the graphics are incredible. I’m a graphic designer, so I need a computer that can keep up with me, and this one definitely does. It’s also really sleek and stylish, which is a plus. Overall, I’m very happy with my purchase and would definitely recommend this computer to others.

We can write the following prompt to get the keywords. After the prompt, you can paste the product review.

Create a list of keywords from the product review after the prompt. 
The keywords should contain the product location,
the sentiment (positive, negative, neutral),
and up to 5 key features of the product mentioned in the review.

### Paste your prompt here

ChatGPT replies with the following

3. Converting raw open ended data into tables

ChatGPT can convert paragraphs, lists, JSON (a programming output) into tables very quickly. I find myself using this feature the most.

I copy and paste the data into ChatGPT and tell it to convert it into an Excel table, with the headers I provide.

For example, let’s say I wanted an Excel table of all the Michelin starred restaurants in Bangkok.

I first go to the Bangkok Michelin guide website: https://guide.michelin.com/th/en/bangkok-region/bangkok/restaurants

Then I copy the restaurant names by dragging my cursor over all the images and copying the text

Dragging the cursor and copying the text

I then write the following prompt into ChatGPT. And paste the text I copied from the website

Convert this text into an excel table with the headers: 
Restaurant Name | Price | Cuisine.
Sae Phun
Bangkok, Thailand
฿ · Street Food
Methavalai Sorndaeng
Bangkok, Thailand
฿฿ · Thai
Reserve a table
Jay Fai
Bangkok, Thailand
฿฿ · Street Food
Reserve a table
Pad Thai Fai Ta Lu (Dinsor Road)
Bangkok, Thailand
฿ · Street Food

ChatGPT comes up with the following table

You can do this with any sort of free form data you want to convert into a table. Then copy and paste the table into a spreadsheet

4. Generate fake data for testing

For demos, slides, and much more, I often need fake data.

ChatGPT makes it super easy to create fake data.

Let’s say I want a list of 20 fake names, with occupation, and location. I want half the location to be in the EU, and the other half in Asia.

I can put in the following prompt to ChatGPT

Create a table of 20 fake people with the following headers: 
Name, City, Occupation.

10 of these people should be from the EU,
and the other 10 should be living in Asia

ChatGPT comes up with the following table that once again you can copy and paste into Excel

Parting thoughts

  1. ChatGPT and other chat bots should not be used with sensitive data. If you wish to use this technology with proprietary data then you need to host and use your own model. You can schedule a free call with our partner service Woyera to learn how to do that
  2. If you wish to incorporate any of these methods into an automation pipeline, then you need to use the OpenAI API. It will provide the same results with the additional benefit of automation
  3. These 4 things are just scratching the surface with ChatGPT. Let us know in the comments whether you would like see any of the examples elaborated

--

--

Love Spreadsheets

AI software to get data from your data sources using just natural language. Try it out for free at www.lovespreadsheets.com