Expressions from time series and multiple constants returned from a query

Hi, I’m using grafana v10.1.2 (8e428858dd) in a raspberry pi running raspbian bookworm, I have successfully connected a database running on my pi to Grafana and plotted the raw data in a dashboard. Now I want to multiply a time series for a constant, this constant is calculated from 4 values stored in a table in the same row but different columns, I want to use an expression to achieve this. If I generate a query for each value, I can do this without problems, but that means that I would have to have 5 queries for each curve. What I want to do is create a query that gets the 4 constant values and then use subindices in the expression to reference them. Is this possible?
Say my constants query is something like:
name = ‘my_name’
I know that each column returned by this query will only have one value. Then I would like to add an expression like this:

Does this make any sense? I don’t know where to look for this; any help will be greatly appreciated.