Convert Dashboard to use Flux query

Dear all,

I would like to convert my dashboard from Influxql to Flux.
The query is the following but I don’t know how to start

SELECT (expiry / 60 / 60 / 24) as "expiry" FROM "x509_cert" WHERE ("source" =~ /^$/) AND $timeFilter GROUP BY  "source" 

many thank