# Options

## Options in RQL Queries

In Roic AI API's query language (RQL), options are configurable parameters that modify how data is displayed or retrieved. Here we will cover six primary display parameters: `showdates`, `showheaders`, `showquery`, `transpose`, and `xlsort`. These options allow for customized data presentation and are essential for tailoring query outputs to specific analytical needs.

### Show Dates (`showdates`)

The `showdates` parameter controls the visibility of dates associated with each data point returned by the query.

* **Mnemonic**: `showdates`
* **Valid Values**:
  * `False` or `N` (Default for single data point): Dates are not shown.
  * `True` or `Y` (Default for multiple data points): Dates are shown.

**Example Usage**:

*   Hide dates when retrieving a single data point:

    ```rql
    query="get(px_last) for('AAPL US')"
    ```
*   Show dates when retrieving a single data point:

    ```rql
    query="get(px_last) for('AAPL US')"&showdates=True
    ```

### Show Headers (`showheaders`)

The `showheaders` option dictates whether column headers are included in the output.

* **Mnemonic**: `showheaders`
* **Valid Values**:
  * `False` or `N` (Default for single data point): Headers are not shown.
  * `True` or `Y` (Default for multiple data points): Headers are shown.

**Example Usage**:

*   Retrieve data with headers:

    ```rql
    query="get(eps(fa_period_type=Q)) for('AAPL US')"&showheaders=True
    ```
*   Retrieve data without headers:

    ```rql
    query="get(eps(fa_period_type=Q)) for('AAPL US')"&showheaders=False
    ```

### Show Query (`showquery`)

Enables the display of the raw RQL query string that was used to retrieve the data.

* **Mnemonic**: `showquery`
* **Valid Values**:
  * `False` or `N` (Default): The query is not shown.
  * `True` or `Y`: Displays the raw query string.

**Example Usage**:

*   Display the raw query string:

    ```rql
    query="get(eps) for('AAPL US')"&showquery=True
    ```

### Transpose Axes (`transpose`)

This parameter controls the orientation of the data table.

* **Mnemonic**: `transpose`
* **Valid Values**:
  * `False` or `N` (Default): Data is returned in a vertical format.
  * `True` or `Y`: Data is returned in a horizontal format.

**Example Usage**:

*   Transpose data to horizontal format:

    ```rql
    query="get(eps) for('AAPL US')"&transpose=True
    ```

### Sort Dates (`xlsort`)

Determines the order in which dates are displayed in a time series output.

* **Mnemonic**: `xlsort`
* **Valid Values**:
  * `ASC`: Ascending order from the oldest to most recent.
  * `DESC` (Default): Descending order from the most recent to oldest.

**Example Usage**:

*   Sort dates in descending order:

    ```rql
    query="get(eps) for('AAPL US')"&xlsort=DESC
    ```

Each of these parameters can be used individually or combined to customize the output of your RQL queries to fit your specific analysis requirements, enhancing the readability and functionality of the data retrieved.
