How do I save queries and results?

Prev Next

Once a query gives you what you need, LumiCode can keep it wherever it's most useful: the results as a file on your computer or in Drive, ready for Excel or to share, or the query itself as a Saved Query in LUSID Workspaces that you and your colleagues can run again. For a quick paste into a spreadsheet or a message, you can copy it instead.

Which method to use

You want to keep

Use

The results, as a file on your computer

/save → local file

The results, in Drive to share

/save → FINBOURNE Drive

The query, to run again later

/save → LUSID Saved Queries

The query or results, to paste somewhere

/copy

Prerequisites

  • LumiCode installed and signed in. See How do I install LumiCode?

  • A query that has just run, or past results loaded with /results.

  • To save to Drive or to Saved Queries, permission to write to the folder or workspace.

Methods

Method 1: Save the results to a file or to Drive

  1. Type /save and press Enter.

  2. Choose local file or FINBOURNE Drive.

  3. Choose the format: csv, excel, parquet, sqlite, xml or json.

  4. Browse to the folder and enter a file name. To overwrite a file, select it.

LumiCode saves every row of the result, and says how many rows it saved and where. Press Esc at any question to go back one step.

Method 2: Save the query as a Saved Query

  1. Type /save and press Enter.

  2. Choose LUSID Saved Queries.

  3. Choose the workspace, then enter a group, a name and a description.

To run it again later, use /run and choose LUSID Saved Queries. To move, rename or delete it, use /queries.

You can also save a query from /recent: select it and choose make it into a saved query, or save it to a file for a .sql file.

Method 3: Copy to the clipboard

  • /copy: the last query, as it ran.

  • /copy result: every row of the last result, as tab-separated values ready to paste into a spreadsheet. Add csv or md for comma-separated values or a Markdown table. This stops at 50,000 rows; use /save for more.

  • /copy transcript: the whole session as Markdown.

Saving a multi-query

After a multi-query has run, /save can also save all its results as one file, or the set itself. See How do I run several queries together as a multi-query?