cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Transform "There are no records" into 0 with DQL

elenaperez
Dynatrace Contributor
Dynatrace Contributor

Hi,

I am trying to transform the message "There are no records" in my tile to a single 0 (or an array of zeros).

I have tried using union:true, nonempty:true, and the coalesce function but none of them seem to work. I assume this is because the query uses 2 timeseries joined.

Is there a way to achieve this?

Here is my DQL:

 

timeseries count = sum(dt.service.request.count, default:0), by: { dt.entity.service }, filter: { failed == true }
| join [ timeseries count = sum(dt.service.request.count, default:0), by: { dt.entity.service } ], on: { dt.entity.service }, fields: { operand = count }
| filter { ( in(dt.entity.service, classicEntitySelector("type(service),tag(\"Kubernetes_ClusterName:payments\")"))) }
| fieldsAdd expression = count[] / operand[]
| fieldsRemove operand, count
| summarize { expression = avg(expression[] ) }, by: { interval, timeframe }
| sort arrayAvg(expression) desc

 

Thanks in advance!

0 REPLIES 0

Featured Posts