I have a doubt. I currently have a cube with a preAggregation defined with day granularity and some measures A, B, C
.
The preAggregation works fine when I query using timeDimension
with a fixed dateRange
and granularity
(it retrieves a time series that I can plot in a chart, so everything is ok to this point).
My problem is that I also want to show these measures (A, B, C
) averaged as a single value, but if I remove the granularity
from the timeDimension
, the cube stops using the preAggregation, and instead it performs the full query.
Summarizing:
I need a to retrieve a measure
(such as sales $$$) for each day of a fixed time range (separated as a series), and I also need the monthly average (as a single number). How do I build the second query (single value measure
)? For the first one, I simply add the following timeDimension
:
{
"granularity": "day",
"dimension": "timestamp",
"dateRange": [
"2020-01-26T00:00:00Z",
"2020-02-06T00:00:00Z"
]
}
But when I want the measure aggregated for the same dateRange
as a single value, I don't know how to build the query.