-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Hi,
I’m currently trying to make a single Cube.js API request that contains multiple query types—specifically, one regularQuery and one dateRangeCompareQuery.
Below are my request parameters:
[
{
"measures": [
"metrics.metrics_a"
],
"dimensions": [],
"filters": [
{
"member": "workspace.workspace_name",
"operator": "equals",
"values": [
"hooli"
]
}
],
"timeDimensions": [
{
"dimension": "metrics.period",
"granularity": "day",
"dateRange": [
"2025-03-17",
"2025-04-15"
]
}
],
"order": {
"metrics.period": "desc"
},
"limit": 1000
},
{
"measures": [
"metrics.metrics_a"
],
"dimensions": [],
"filters": [
{
"member": "workspace.workspace_name",
"operator": "equals",
"values": [
"hooli"
]
}
],
"timeDimensions": [
{
"dimension": "metrics.period",
"granularity": "day",
"compareDateRange": [
[
"2025-03-17",
"2025-04-15"
],
[
"2025-03-10",
"2025-04-08"
]
]
}
],
"order": {
"metrics.period": "desc"
},
"limit": 1000
}
]This returns a blendingQuery resultset.
What surprises me is that when I call resultset.decompose(), the returned set contains two regularQuery resultsets instead of one regularQuery and one dateRangeCompareQuery. Moreover, the tablePivot() and tableColumns() of the blendingQuery resultset do not return the expected columns or data.
Normally, I expect the blendingQueryResultset’s tablePivot() to properly arrange and aggregate the data.
Additionally, if tablePivot() does not meet my requirements, I would use resultset.decompose() to handle the queries individually. But as it is, I cannot properly retrieve the resultset for the dateRangeCompareQuery.
Could it be that my query usage is incorrect?