Uploading CSVs
The CSV upload feature is currently in beta. To have this feature enabled, reach out to Omni support: support@omni.co.
Some times you may want to utilize data in an analysis that isn't in one of your database connections, whether it's for data enrichment or an initial exploration. Uploading CSVs into a workbook allows you to quickly add data to Omni without needing touch your data pipelines.
Requirements
To upload CSVs, you'll need:
- Restricted Querier, Querier, or Connection Admin permissions
- A CSV that:
- Is uniquely named at the connection level. Omni won't reject a duplicate CSV, but its data will be overwritten
- Contains a header row, which will be used to create columns
- Contains less than 50,000 rows
Limitations
In the initial release of CSV uploads, CSVs:
- Must be uploaded in a workbook
- Can't be used in joins, even if promoted to the shared model
Uploading CSVs in a workbook
CSVs can be uploaded in the workbook of any document.
-
In a workbook, navigate to Model > Upload CSV.
-
Click Choose File and locate the file you want to upload.
-
If you have Querier or Connection Admin permissions, you'll see a Create topic checkbox. Checking this box will create a topic from the uploaded CSV.
If you're a Restricted Querier, a topic will automatically be created from the CSV.
-
Click Upload to upload the file.
After the CSV is uploaded, you can:
- Query the data in the new query tab specific to the CSV
- Model and optionally promote the CSV to the shared model
Querying CSV data
Each uploaded CSV is associated with a tab in a workbook and can be queried like any other table, including using the field picker, SQL editor, or working with calculations and formulas.
Note: To make CSV data available outside of the workbook, you'll need to promote it to the shared model.
Joining to workbook data
Though traditional joins can't be used with CSVs, you can use XLOOKUP
to perform cross-tab analysis in a workbook.
For example, you have a workbook with two tabs: Sales
, which is backed by a topic, and products.csv
, which is a CSV upload. You want to include the names of products purchased in an order alongside other sales data. To join the data in the products.csv
tab to your sales, you could use an XLOOKUP
formula like the following to create a new calculation in the Sales
tab:
=XLOOKUP(A1,'products.csv'!B:B, 'products.csv'!C:C)
# Syntax
=XLOOKUP(lookup_value, <query_tab_name>!<lookup_range>, <query_tab_name>!<return_range>)

Modeling & promoting CSVs
When a CSV is uploaded into a workbook, a few things will happen in the workbook model. To make the changes available outside of the workbook, they must be promoted to the shared model.
-
A view representing the CSV will be created. These views can be identified by the presence of an
uploaded_table_name
parameter:products.view# Reference this view as products
uploaded_table_name: products.csv::1a3497f5-cba8-47c0-bab9-b2df84d1b141 -
A topic based on the view representing the CSV will be created if:
- Create topic was selected during the CSV upload, or
- A Restricted Querier performed the upload
Views and topics created from CSVs can be modeled like any other view or topic, with the exception of joining them to other data. The content validator in the IDE will return the following error if a CSV is used in a join:
View "<view_name>" references an uploaded table. Uploaded tables cannot be used in joins.
CSV data can only be joined to other tabs in a workbook by using XLOOKUP
. Refer to the Joining to workbook data section for more information and examples.
Managing CSV uploads
Updating CSV data
To update a CSV's data, upload another CSV with the same name. This can occur in the workbook where the CSV was originally uploaded or in a new workbook, as long as the same connection is used. The data in the original CSV will be overwritten.
Note: Previous uploads will be retained in Settings > Uploads. If you create a new analysis from here and promote the changes from the workbook, it will overwrite the CSV data currently in the shared model.
Deleting CSVs
Before deleting a CSV, note that:
- This action will permanently delete the file from your instance and can't be undone
- Querying views and topics built from CSVs will result in an error after the deletion
- Views and topics built from CSVs must be manually removed from models after the deletion
To delete a CSV, navigate to Settings > Uploads. Locate the file you want to remove and click Delete.
