Different versions of data with the same data and query

  • What are you trying to achieve?

I’m trying to graph the percentage of times the ocr predicted the correct value of the field, out of all the times the field showed up that day, for approximately 60 fields over a week

  • How are you trying to achieve it?
    This is my query:

select
cast(convertJobNameToDateTime(fi.jobName)as date) as time,
field_name,
sum ( case when fi.ocr_value is not null
and fi.ocr_value != ‘’
and lower(fi.ocr_value) = lower(fi.verify_value)
then 1.0 else 0.0 end) / count(*)
as ocr
from field_info fi
group by cast(convertJobNameToDateTime(fi.jobName)as date), field_name
order by cast(convertJobNameToDateTime(fi.jobName)as date), field_name

  • What happened?

I got all the correct data, but in different formats depending on the dashboard:

in 1 dashboard I got a time column and a column for each concatenation of ‘ocr’+ ‘field_name’ for each field name - with a value - it comes out about 60 columns
time - ocr_field1 - ocr_field2 … and so on.

in another dashboard I get 3 columns: time - field - value

  • What did you expect to happen?

I should get the data in the same format, as I used the same data, the same query, and no transformations whatsoever.

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were. No

  • Did you follow any online instructions? If so, what is the URL? No