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)
showdates)The showdates parameter controls the visibility of dates associated with each data point returned by the query.
Mnemonic:
showdatesValid Values:
FalseorN(Default for single data point): Dates are not shown.TrueorY(Default for multiple data points): Dates are shown.
Example Usage:
Hide dates when retrieving a single data point:
query="get(px_last) for('AAPL US')"Show dates when retrieving a single data point:
query="get(px_last) for('AAPL US')"&showdates=True
Show Headers (showheaders)
showheaders)The showheaders option dictates whether column headers are included in the output.
Mnemonic:
showheadersValid Values:
FalseorN(Default for single data point): Headers are not shown.TrueorY(Default for multiple data points): Headers are shown.
Example Usage:
Retrieve data with headers:
query="get(eps(fa_period_type=Q)) for('AAPL US')"&showheaders=TrueRetrieve data without headers:
query="get(eps(fa_period_type=Q)) for('AAPL US')"&showheaders=False
Show Query (showquery)
showquery)Enables the display of the raw RQL query string that was used to retrieve the data.
Mnemonic:
showqueryValid Values:
FalseorN(Default): The query is not shown.TrueorY: Displays the raw query string.
Example Usage:
Display the raw query string:
query="get(eps) for('AAPL US')"&showquery=True
Transpose Axes (transpose)
transpose)This parameter controls the orientation of the data table.
Mnemonic:
transposeValid Values:
FalseorN(Default): Data is returned in a vertical format.TrueorY: Data is returned in a horizontal format.
Example Usage:
Transpose data to horizontal format:
query="get(eps) for('AAPL US')"&transpose=True
Sort Dates (xlsort)
xlsort)Determines the order in which dates are displayed in a time series output.
Mnemonic:
xlsortValid 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:
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.
Last updated
Was this helpful?