--- title: "How do I query a dataset?" slug: "how-do-i-query-a-custom-dataset" updated: 2026-06-07T07:12:47Z published: 2026-06-07T07:12:47Z canonical: "support.lusid.com/how-do-i-query-a-custom-dataset" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.lusid.com/llms.txt > Use this file to discover all available pages before exploring further. # How do I query a dataset? You can query a dataset for [records that have been added](/v1/docs/how-do-i-add-records-to-a-custom-dataset) at any time. ## Methods LUSID web appLUSID APILuminesce Call the [QueryRelationalData](https://www.lusid.com/docs/api/lusid/endpoints/relational-datasets/QueryRelationalData/) API, specifying the scope and code of the RDD in the URL, and optionally a request body containing parameters. For example: ```json curl -X POST 'https://.lusid.com/api/api/relationaldatasets/MyDatasets/Addresses/$query'  -H 'Content-Type: application/json-patch+json'  -H 'Authorization: Bearer '  -d '{  "queryMethod": "Latest",  "filter": "effectiveAt gt 2026-01-01",  "customSortBy": [    {      "fieldName": "dataSeries.applicableEntity.entityType",      "remainderOrder": "DESC"    },    {      "fieldName": "dataSeries.seriesIdentifiers[AddressType]",      "remainderOrder": "ASC"    }  ] }' ``` Navigate to the **Data Management > Relational Datasets** dashboard and click the **Display name** of the dataset you want to query, for example: ![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/image-LT3S0W87.png?sv=2026-02-06&spr=https&st=2026-11-09T06%3A50%3A28Z&se=2026-11-09T07%3A50%3A28Z&sr=c&sp=r&sig=FzdFIN6OrifZahU5eTbUuZeKa28FTgW4qX%2B29VIJMNM%3D) Every record in the dataset is returned when **Query Method** is set to **Time Series**. Switch to **Latest** to return just [data series](/v1/docs/anatomy-of-a-dataset), or you can filter fields in the standard way to reduce the number of records: ![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/image-SQIDI581.png?sv=2026-02-06&spr=https&st=2026-11-09T06%3A50%3A28Z&se=2026-11-09T07%3A50%3A28Z&sr=c&sp=r&sig=FzdFIN6OrifZahU5eTbUuZeKa28FTgW4qX%2B29VIJMNM%3D) Write a Luminesce SQL query using the [Lusid.RelationalDataset..](/v1/docs/lusidrelationaldatasetxx) provider and execute it using a tool such as the LUSID web app, for example: ![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/image-0S0XWBY1.png?sv=2026-02-06&spr=https&st=2026-11-09T06%3A50%3A28Z&se=2026-11-09T07%3A50%3A28Z&sr=c&sp=r&sig=FzdFIN6OrifZahU5eTbUuZeKa28FTgW4qX%2B29VIJMNM%3D) ## API request fields This section supplements the [API documentation](https://www.lusid.com/docs/api/lusid/endpoints/relational-datasets/BatchUpsertRelationalData). If omitted, `queryMethod` defaults to `TimeSeries` and every record is returned (including data points within data series). To return just data series, set `queryMethod` to `Latest`. [More information](/v1/docs/anatomy-of-a-dataset). You can optionally specify a `filter` to restrict the data returned. See the section below. You can optionally specify a `customSortBy` object to sort returned data by up to two categories. In the LUSID API example above, records are sorted first by entity type and then by a particular series identifier. Allowed values for `fieldName` are the same as those for filtering in the table below. The `remainderOrder` must either be `ASC` or `DESC`. ## API filtering syntax You can use LUSID’s standard [filter syntax](/v1/docs/filtering-information-retrieved-from-lusid) to reduce the number of records returned by a query: | To filter on… | Syntax | Example(s) | | --- | --- | --- | | Primary key fields | - `dataSeries.seriesScope <operator> <value>` - `dataSeries.applicableEntity.entityType <operator> <value>` - `dataSeries.applicableEntity.entityScope <operator> <value>` - `dataSeries.applicableEntity.identifierScope <operator> <value>` - `dataSeries.applicableEntity.identifierType <operator> <value>` - `dataSeries.applicableEntity.identifierValue <operator> <value>` - `dataSeries.applicableEntity.subentityid <operator> <value>` | - `dataSeries.seriesScope in ('Growth','Income')` - `dataSeries.applicableEntity.identifierType eq 'Isin'` - `dataSeries.applicableEntity.identifierValue exists` | | Effective date | `effectiveAt <operator> <value>` | `effectiveAt gt 2026-01-01` | | Series identifier fields | `dataSeries.seriesIdentifiers[<fieldName>] <operator> <value>` | `dataSeries.seriesIdentifiers[AddressType] neq 'Registered'` | | Value fields | `valueFields[<fieldName>] <operator> <value>` | `valueFields[Street] eq '123 Main Street'` | | Metadata fields | `metaDataFields[<fieldName>] <operator> <value>` | `metaDataFields[Email] startswith 'john@'` |