Hi,
is there a way to perform operations on the data before creating the aggregation? In my example the aggregation is created and then the aggregate data is multiplied * 10. I have to multiply the data and than aggregate (without change the original data). Thanks
"aggs": {
"dateHistogram": {
"date_histogram": {
"field": "timestamp",
"time_zone": "Europe/Rome",
"min_doc_count": 1,
"calendar_interval": "1M"
},
"aggs": {
"cumulativeSales": {
"sum": {
"field": "value"
}
}
}
}
},
"script_fields": {
"formulaField": {
"script": {
"source": "doc['value'].value * 10"
}
}
}