When exporting files that use Wdata queries, we recommend including all connected source files in your export. Queries exported without these files can still be imported to the destination workspace, but they won't work properly until the missing files are added. This is known as a "broken query."
Requirements
- Only Workspace Owners and Content Managers can import or export Workiva files.
Identifying a broken query
When selecting an imported file from the Wdata Home screen, you may notice an error message in the Details panel. This error can occur when working with a query, a query view, or a document that is connected to a query. It reads:
This query contains invalid syntax or a missing data source. Dependent queries will also be impacted.
Adding missing source files
Once a broken query is identified, there are two ways to add the missing files to your workspace:
- Export the missing files: Return to the original workspace and export only the missing files, then upload them to the destination workspace. This is recommended when you have access to both workspaces. Learn more about importing files.
- Recreate the missing files: Manually recreate the missing files in the new workspace. This is recommended when working with a small number of files, or when you don't have access to the original workspace.
Repairing the query
Once you've identified the broken query and added the missing source files to your workspace, you must add the source file to the query itself. Workiva will automatically amend your SQL code with the new file IDs -- this redirects your "broken" files to their proper data source and repairs the query.
Note: You can also replace missing files by manually editing the SQL statement. This is recommended for advanced users only. Learn more about creating queries.
Here's how it works:
- From Wdata Home, select the broken query.
- On the right side of the screen, you'll see an error message displayed at the top of the Details panel. Click Open query to advance to the SQL Editor screen.
- Any missing files will be listed in the Sources panel on the left side. Click Replace missing <source file type>.
Note: Workiva automatically identifies the missing file type. To demonstrate this, the screenshot above shows a missing table, sheet, ESG program, query, and ESG explorer data -- but it's unlikely your query will include all of these.
- Search for your missing source file or select it from the list, then click Replace.
- Click Save at the top left.
Note: When adding a spreadsheet file, you must also specify a sheet as your source. All other file types will simply display the included columns.
Once saved, your SQL query will automatically update with the correct syntax and your new sources will appear in the lefthand side panel.
FAQ
What if I add the wrong source file to a query?
You can swap out one source file for another by right-clicking on the incorrect file in the Sources panel, and then selecting Replace Source.
Learn more about managing query sources
Can I just start over and import my data again?
Yes, but there are a few things to keep in mind:
- You'll need access to the original workspace.
- You must remove all previously imported data from your destination workspace.
- An import cannot be undone.
If previously imported data isn't removed, importing a second time will result in duplicate files throughout your workspace. For this reason, we only recommend this approach when working with a large number of queries or in a brand new workspace.
Are existing or duplicate files overwritten during an import?
No. If a file already exists in the workspace, the import will simply create a duplicate.