Mark green if there is at least one green record per day

Hi Grafana comunnity.

Can you help me with this type of issue?

We have Grafana (with Influxdb source) weekly dashboard for gathering histogram of our Jenkins pipelines. And I would like to ask you if there is any way how to show only one final result per day (there are many of runs per day because of troubleshooting etc.). We would like to “mark green if there is at least one record green per day” - regardless of results of rest of the records.

Our influxdb query:
SELECT build_result_ordinal FROM “jenkins_data” WHERE (“project_name” = ‘pipeline-x’ AND $timeFilter)

Results (0 means successful):
day 1:

day 2:

How about something like:

select count(build_result_oridinal) from jenkins_data where
project_name=‘pipeline-x’ and build_result_ordinal=0 and $timeFilter

If the answer > 0 you show green; if the answer = 0 you don’t.


What @pooh said. Also if you need a single result per day, add a GROUP BY time(1d) at the end of the query.

That will (I think) return no data for days with no successful builds. If you do want days without successful builds to also return something, you can add e.g. fill(-1) to the GROUP BY clause.

thanks a lot… working for me