Create Merge Query

Version 4.0.25.2 (latest)

Create Merge Query

Creates a new merge query object.

A merge query takes the results of one or more queries and combines (merges) the results according to field mapping definitions. The result is similar to a SQL left outer join.

A merge query can merge results of queries from different SQL databases.

The order that queries are defined in the source_queries array property is significant. The first query in the array defines the primary key into which the results of subsequent queries will be merged.

Like model/view query objects, merge queries are immutable and have structural identity - if you make a request to create a new merge query that is identical to an existing merge query, the existing merge query will be returned instead of creating a duplicate. Conversely, any change to the contents of a merge query will produce a new object with a new id.

Request

POST /merge_queries
Datatype
Description
Request
HTTP Request
body
HTTP Body
body
Merge Query
can
object
Operations the current user is able to perform on this object
column_limit
string
Column Limit
dynamic_fields
string
Dynamic Fields
id
string
Unique Id
pivots
string[]
result_maker_id
string
Unique to get results
sorts
string[]
source_queries
total
boolean
Total
vis_config
object
Visualization Config
query
HTTP Query
fields
string
Requested fields

Response

Datatype
Description
(object)
can
object
Operations the current user is able to perform on this object
column_limit
string
Column Limit
dynamic_fields
string
Dynamic Fields
id
string
Unique Id
pivots
string[]
result_maker_id
string
Unique to get results
sorts
string[]
source_queries
merge_fields
field_name
string
Field name to map onto in the merged results
source_field_name
string
Field name from the source query
name
string
Display name
query_id
string
Id of the query to merge
query_slug
string
Slug of the query to merge
total
boolean
Total
vis_config
object
Visualization Config
Datatype
Description
(object)
message
string
Error details
documentation_url
string
Documentation link
Datatype
Description
(object)
message
string
Error details
documentation_url
string
Documentation link
Datatype
Description
(object)
message
string
Error details
documentation_url
string
Documentation link
Datatype
Description
(object)
message
string
Error details
field
string
Field with error
code
string
Error code
message
string
Error info message
documentation_url
string
Documentation link
documentation_url
string
Documentation link
Datatype
Description
(object)
message
string
Error details
documentation_url
string
Documentation link

Examples