Hello team! I'm currently trying to get an averag...
# gooddata-ui
j
Hello team! I'm currently trying to get an average aggregate of my data and using the following
const selectedMeasure = modifySimpleMeasure(metricMap[metricKey], (m) => m.aggregation("avg").defaultLocalId());
however, the measure is returning the default "sum" agg instead of the average, just wanted to reach out to see if I've made a mistake in my implementation here, thank you!
j
Hello Janzen, Could you please confirm what SDK and React version are you currently using? I will pass your question to our Technical team in the meantime.
f
Hey Janzen, I understand you are using our execution model to Modify a Measure. The one thing I might suggest, from the get go, is to attempt using
modifyMeasure
instead of
modifySimpleMeasure
, as the former works on more types of aggregation. Also, can you tell me more about the data you are attempting to aggregate? Is it a fact, or is it a MAQL metric? Otherwise, the code snippet you shared does match our documentation and expected use-cases.