Functions Language

ExportCSV

The ExportCSV() function takes a data block and exports it into a CSV file. This function is only available in the Quintessence Language (for example, Reports).


Syntax:

ExportCSV(Data, File, [useQuotes])
  • In the Quintessence Editor (Studio) using Python language, use: Qx.ExportCSV()
 See parameter descriptions

DataThe data that will be exported.
FileThe path to the CSV file to export.
UseQuotes
(optional)
Add quotes around each value.

Remarks:

  • Default parameters are:
    • UseQuotes: False
  • This function does not return any value when executed successfully.
  • If the CSV file exists any existing data in the file will be overwritten.

Examples:

The examples provided below are based on fictitious data for illustrative purposes only.

> Example 1: Export data into a CSV file


Data is stored in a variable called data_set.

data_to_export := ExportCSV(data_set, "C:\Generated data.csv", True);

This will export the data in data_set into a CSV file called Generated data on the C: drive. Every value in data_set will be wrapped in quotes.