---
title: Configure DataHub Query Parameters
slug: solutions/configure-datahub-query-parameters
docTags: 
createdAt: 2025-03-20T16:56:28.275Z
---

You can configure the query parameters by setting the order of results, applying limits to your query, and specifying the time range for your data queries.

# Before You Begin

- Ensure that connections have been previously created and are visible in the connection table. See [Define DataHub Connections](docId:6O3gZwf3GM2lWncmEkBjw) for details.
- Familiarity with [Defining DataHub Queries](docId\:oMHojZngGmS4X03ZfjEOC) and [Managing DataHub Queries](docId\:Ue9J-nOASlvYFpzDWSTmk).

# Steps to Configure Order, Limit, and Time Range Parameters

This guide discusses three key parameters that you can configure. These elements include:&#x20;

- **Ordering:** Managing the query order (ascending or descending).
- **Limit:** Setting or removing a limit on the query results.
- **Time Range:** Determining the segment of data to query from the table.

## Configure Order of Queries

- The **Order By** element manipulates the ordering section.
- By default, the ordering is set to **ASCENDING**.
- To change the order, switch the setting to **DESCENDING&#x20;**&#x66;rom the drop-down menu.
  &#x20;*Note:* This adjustment is directly reflected in the Query Statement.

:::hint{type="info"}
**Note:&#x20;**&#x41; *Query Statement&#x20;*&#x69;s a live display that reflects the user's configuration parameters—like order, limit, and time range—allowing for real-time data retrieval from the *DataHub&#x20;*&#x6F;r external *Database*.
:::

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/aoZ_JdQi2Ijr3XehI3MRV-20251103-120115.png" size="70" width="1092" height="520" position="center" showCaption="false"}

## Configure Limits of Queries

- The **Limit** parameter is not set by default.
- When a *Limit* is applied, the adjustments become visible in the *Query Statement*.
- The *SLIMIT&#x20;*&#x6F;ption restricts the number of series returned by a query, similar to how the *LIMIT* clause restricts the number of points.&#x20;
- Removing respective settings (*Limit* or *SLimit*) will hide the respective sections from the *Query Statement*.

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/RVj3sKBA7gJ5eGJrxU2sW-20251103-121229.png" size="70" width="1086" height="452" position="center" showCaption="false"}

## Configure Time Range of Queries

The time range parameter determines the section of the table from which data is queried.&#x20;

### Using the Dropdown

- The *Litmus DataHub Queries* interface provides preset time frames via a drop-down menu.
- These presets are designed to simplify stopping data pull and setting the appropriate time range.

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/oIA7BRjFNxLceNqQFAYtS-20251103-121353.png" size="70" width="1089" height="596" position="center" showCaption="false"}

### Using the Time Range Editor

If a preset does not meet your needs, click the **Edit&#x20;**(*pencil icon*) button to use the time range editor.&#x20;

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/S635sSt0evHW85wm33CmC-20251103-121920.png" size="80" width="1079" height="810" position="center" showCaption="false"}

- The default values shown are typically **From&#x20;**&#x61;s minus one hour and **To** as the current time.
- The **From** value must always be in the past.
- Click the **Edit&#x20;**(*pencil icon*) next to the *From&#x20;*&#x6F;r *To&#x20;*&#x69;nput box to change the time unit using a numeric spinner (e.g., hours, minutes, seconds, days, weeks, months, or years).
  - This allows precise control over the time span, such as setting the query for the last four hours.

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/KM6WapnCtVFk7RVRbq5G5-20251103-122038.png" size="70" width="1079" height="810" position="center" showCaption="false"}

- Click the **Calendar&#x20;**&#x69;con next to the *Edit&#x20;*&#x62;utton to query data requiring a specific date range.&#x20;
  - Once applied, the query consistently pulls data from the specified fixed time frame regardless of subsequent updates.&#x20;

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/taluwff17CHn_q_H_74eL-20251103-122254.png" size="70" width="1079" height="810" position="center" showCaption="false"}

- After defining the *Time Range&#x20;*&#x70;arameter, click **Save**.
- The saved settings will modify the time range and immediately reflect the changes in the *Query Statement*.

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/B26cSwRCMy5XA18Kdl6r0-20251103-122407.png" size="70" width="1079" height="810" position="center" showCaption="false"}

:::hint{type="info"}
### Key Points to Remember

- It is possible to **freeze** the *From* value and let the *To* value update.
  - This approach enables continuous data accumulation, useful for comparative analyses or experiments.
- You can use relative time for dynamic reports that update, such as always pulling data from the last five to eight hours.&#x20;
- The *Time Range Editor&#x20;*&#x70;rovides the option to configure the range into the past or future.
  - *Example:&#x20;*&#x54;o extract data from six to eight when running the query at nine o’clock, adjust the range accordingly.
:::

