Division of two fields

I am having this issue where i try to divide two numbers and keeps giving me the subtraction of two other fields, above there’s some images to show:

The “Result” should given by the operation circled in yellow, but it seems like it’s being given by the operation in blue. Also if i try to replace the division for a sum or a subtraction operation, it gives me the correct value.

are all of these values from one query or different queries? What version of grafana are you on, the following is on v12.0.2

it might be better to do it at the datasource instead of relying on Transformations

Hello @automacaomultipet01,

I’ve implemented a solution to your issue using a PostgreSQL query, along with the required data transformations.
Kindly review it at your convenience — I hope you find it helpful.

Step: 1 Implement the query shown in the screenshot.

Step: 2 Write the query in the Query section and add transformations:

"SELECT
  count AS "Count",
  "ON time",
  "Fail time",
  "Real time"
FROM your_table_name;"

Final output:

Hello @jangaraj @yosiasz ,

Could you please review my solution? If it is correct, kindly mark it as the accepted solution.

Thank you!

Great job @infofcc3

Let’s wait and see what OP says as you have provided a solution identical to already posted possible solution

We don’t know yet what data source they use

I’m using elasticsearch as my data source and those values are from different queries. My grafana version is 9.5.3.

Hello @automacaomultipet01 ,

Just checking in—did this solution resolve your issue, or are you still facing the same problem?