Skip to content

Analyse data from a file

What it does

The assistant can answer a question about a table you attach: a sum per category, the product with the highest value, a count or an average. When the code interpreter is available, it runs a short program over the whole file and answers with the computed figures instead of guessing from the first rows. It does not change your file; a result table or chart arrives as a new file in the reply.

How to ask

Attach the file to the same message as the question: click the + button in the composer, select Add files or photos and choose the file. Say what the answer should look like, for example "one line per category". Below are two prompts you can copy and adapt. Each prompt was run on the three Myra-hosted models, ten runs each, with the test file attached. A run counts as passed when the answer contains the facts from the file (names, numbers); for the product question it also must not name another product. The language of the answer is not part of the check. The table shows how many of the ten runs passed.

Attach a CSV file with the columns Category and Amount (60 rows, three categories) to this message.

Sum per category

What is the total amount per category in the attached file? Answer with one line per category.

Tested on: qwen3.8-27b, gemma-4-31b-it, mistral-small-4

Returns the three category totals, one line each.

Attach a CSV file with the columns Product, Qty and Price (three products) to this message.

Top product by value

Which product in the attached file has the highest total value (quantity times price)? Answer with only the product name and its value.

Tested on: qwen3.8-27b, gemma-4-31b-it, mistral-small-4

Returns the product with the highest value and that value.

Prompt Test case qwen3.8-27b gemma-4-31b-it mistral-small-4
Sum per category Totals of three categories over 60 rows of a CSV file 10/10 10/10 10/10
Top product by value Product with the highest quantity times price in a CSV file 10/10 10/10 10/10

Tips

  • Attach the file to the same message as the question.
  • Say how the answer should look: "one line per category", "only the product name and its value".
  • Say how a value is computed when the file does not hold it, as in "quantity times price".
  • You can attach up to 10 files to one message.

Limits

  • The formats .csv, .tsv, .xlsx, .xlsm and .ods are accepted, and so is .json. See Chat: Importing a file for the full list, the size limit per file and the error messages.
  • Exact figures come from a program the assistant runs over the whole file. This needs a gateway with the code interpreter switched on and a model that can use tools; otherwise the assistant works from a text preview that can be cut off. See Code interpreter.
  • If no code ran, the reply carries the note "No code was executed for this answer". On the latest answer, click Regenerate on the note, or check the figures against your file.
  • On a gateway with data protection whose settings cannot guarantee that the program's results are masked before they leave the gateway, or in ghost mode (a private chat), the raw file is not given to the code interpreter; the answer then comes from the text preview.
  • The prompts above were checked on Myra-hosted models with one small file each. A reworded prompt, a larger file or another model can behave differently, so check the figures that matter against your file.

When something goes wrong

  • A notice says the preview was cut off, or the reply carries the note "No code was executed for this answer". The answer was not computed over the whole file. On the latest answer, click Regenerate on the note, or check the figures against your file.
  • The file chip is red after sending. The file could not be processed at that moment. When one of several attached files fails, the message is not sent and that file's chip turns red; press Send again to retry only that file.
  • The composer reports that the file is too large. The file is not uploaded. Choose a smaller file or split it.
  • The error lists the supported formats. The file type is not accepted. Save the table as .csv or .xlsx and attach it again.