Advanced JSON input option in Datatable is not supporting aggregation

Hello Team,

I am trying to take a percentage value using two fields in data table visualization , though Data tables doesn't support bucket script or Math ,i am trying to write my aggregation query inside Advanced option

Below is the query which i am trying to put in Advanced option

{
"aggs": {
"dentination_wise": {
"terms": {
"field": "CALLED_NUMBER_COUNTRY_ABBR.keyword",
"size": 20
},
"aggs": {
"sumofin": {
"sum": {
"field": "INCOMING_TRUNK_PRESENT"
}
},
"sumofcs": {
"sum": {
"field": "CALL_ANSWER_STATUS"
}
},
"percentage": {
"bucket_script": {
"buckets_path": {
"my_var1": "sumofcs",
"my_var2": "sumofin"
},
"script": "params.my_var1 / params.my_var2*100"
}
}
}
}
}
}

But I am getting an Internal Server Error, Is it something not supported by Elasticsearch, What are the other option to take out percentage value then? except Visual Builder. Seeking your help :frowning:

Thanks
Ramya

Advanced JSON input can only extend additional config for the aggregation you selected, you can't use it to execute other aggregations. For calculating percentages like this you currently have to use visual builder or vega (you can freely specify your Elasticsearch query there).

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.