Hi,
I have a kibana query that calculates percentage change over a period of 15 minutes. The query works just fine except when the doc_count : 0.
When I get a doc_count : 0 for that interval it does not calculate percentage change and in the next interval I get "null" I understand the math behind it but is it possible to still calculate percentage change when doc_count : 0 ??
Please refer to the 12:00 PM and 12:00 PM interval for reference below...
Query Result :
"buckets" : [
{
"key" : "c91f8152d1e3dea4bd2c7ace418c10fbb981893c",
"doc_count" : 138029,
"every15min" : {
"buckets" : [
{
"key_as_string" : "2020-06-20T11:30:00.000-06:00",
"key" : 1592674200000,
"doc_count" : 38752
},
{
"key_as_string" : "2020-06-20T11:45:00.000-06:00",
"key" : 1592675100000,
"doc_count" : 41174,
"significantChange" : {
"value" : 2422.0
},
"significantChangePerc" : {
"value" : 6.25
}
},
{
"key_as_string" : "2020-06-20T12:00:00.000-06:00",
"key" : 1592676000000,
"doc_count" : 0,
"significantChange" : {
"value" : -41174.0
}
},
{
"key_as_string" : "2020-06-20T12:15:00.000-06:00",
"key" : 1592676900000,
"doc_count" : 38737,
"significantChange" : {
"value" : 38737.0
},
"significantChangePerc" : {
"value" : null
}
},
{
"key_as_string" : "2020-06-20T12:30:00.000-06:00",
"key" : 1592677800000,
"doc_count" : 19366,
"significantChange" : {
"value" : -19371.0
},
"significantChangePerc" : {
"value" : -50.006453778041674
}
}
]
}
}
As seen I dont see percentage change calculated when doc_count: 0 I would like to see for example -100% there. Is it possible ?