Double Scripted Field gets fetched as string when filtering in a Dashboard

Hey guys,

I have a scripted field which returns a percentage value based on 2 keys in my documents. The scripted field is set to return 0 when the keys return a NaN value due to one of them being missing.

The script and formatting on this scripted field:

This, according to the error returns a dobule.

Here is what happens if I try to use the KQL filter on a dashboard using this key.

From what I understand, one of the values being compared is a string, which causes the comparison to fail. I fail to understand which of the values is the string (scripted field or my filter value).

Is there something wrong on my part?

We are running kibana 7.12-snapshot on a platinum license.

Thanks in advance and kind regards,

David.

Under Stack management -> Index patterns, you can view the type for each field in an index pattern. Use this to figure out that types are returned for you fields. Then you can use casting in your scripted field to cast the value to a number.

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