Prompt Guide

Similar to talking to ChatGPT, Rasgo's AI understands some questions better than others. Here's a guide to craft the best possible question prompts for your data question.

Tips for Success

Tip: The more specific you can be, the better

Rasgo's AI is using your question to study its notes, pick the right table or tables, and then craft an accurate SQL query. That's a lot of steps! The more detail you can share in your prompt, the better AI will do at navigating that task. Details that can be helpful to include:
  • How should AI aggregate the data, if at all (i.e. Total, Average, Max, etc...)
  • Do you have an idea of what table or tables AI should look at? Even a guess can be helpful (i.e. "Use our Master Sales table")
  • Want your query to apply filters to the data? Include both the column and the values in that column you want to filter, if possible (i.e. "... for customer Acme Corp", where customer is the column and Acme Corp is the value in the customer column that you want to filter to)

Tip: Don't tell AI what NOT to do

Just like a 5 year old, you don't want to give AI the wrong ideas... It's not very good at discerning the "negative" instruction (i.e. "Don't use column ABC"). Instead, focus on telling AI what to do whenever possible (i.e. "Use a column starting with DEF").

Tip: When in doubt, you can always trust the "Mad Libs" prompt

If you're not sure where to start, this is a good template that very reliably translates to SQL:
Sum <Column A> and <Column B> by <Column C> for the current time period using <Date Column D>
Generative AI can generate some impressive SQL but it never hurts to start with the basics.

Examples for Inspiration

Not Optimized
sales for Acme Corp
total sales for Customer Name Acme Corp by month
  • "Total" tells AI to sum the sales, instead of selecting rows of transactions
  • Customer Name helps AI find the right column
top products based on growth
Top 10 products by total sales based on year over year change for current year vs previous year
  • "by total sales" tells AI what data to use to rank the products
  • "current year vs previous year" indicates the time ranges for calculating the growth rate
  • using terms like "current" and "previous" will result in analysis that is relative to the current date
  • if you prefer hard coded dates, you would instead say "for 2023 vs 2022"
what color products are popular
What are the top 10 most popular product colors based on number of orders for the current year to date
  • including a date range will help limit the data queried
  • "based on number of orders" tells AI what metric to use to approximate popularity

Rasgo AI Limitations

  • Rasgo AI can only process feedback on the SQL it generates today. This means that if you ask a follow up question about the Data Visualization, Headline, or natural language interpretation sections, Rasgo's AI will not know what to do.
  • Rasgo AI, like all generative AI, is token limited. If you ask a question that generates a particularly large query, Rasgo won't be able to intelligently interpret the output data, and you will only get back a Visualization and a SQL Query Summary.
  • Rasgo AI has to search through your data warehouse metadata to find the right table to use. That means if there is no human documentation of the tables and columns in those tables, all the AI has to go off of is the column names and table name when deciding whether or not to pick that table.