Join different data source types for labels

I’m having trouble finding a way to link two different data types for the purpose of labels.

For example, I have an influx time-series with all the measurements i want, but that data has device IDs and no other identifying data like customer id, location, etc.

I have a second data source, which I’m testing google sheets, mysql, anything I can to try to bring this in, that has the device id as well as the other ‘missing’ data in columns.

I want to do a classic join, ie join on datasource1.device_id = datasource2.device_id so I can then get those labels into charts as well as use variables to filter on. So I can have ‘customer’ and ‘location’ variables and put those into teh query on /^$Customer$/ and /^$Location$/ for example.

The details/labels isn’t time series, so I can’t join on time with an ‘outer join’ transform.

Is this possible?

1 Like

could you please provide sample data for influx like

_time,_value,_measurement,_field
2022-07-12 10:00:18.240,96.27,mqtt_consumer,Kettle
2022-07-12 11:00:18.240,50.54,mqtt_consumer,Kettle
2022-07-12 12:00:18.240,99.59,mqtt_consumer,Kettle
2022-07-12 13:00:18.240,92.83,mqtt_consumer,Kettle
2022-07-12 14:00:18.240,76.01,mqtt_consumer,Kettle
2022-07-12 15:00:18.240,28.23,mqtt_consumer,Kettle
2022-07-12 16:00:18.240,37.46,mqtt_consumer,Kettle

and the same with the other data source?

While your explanations are spot on sample data is much better to provide you real world solutions and not guess and back and forth.

yeah, so just top copy your example:
influx
timestame, device-id temp,humidity
2022-07-12, SN12345 75, 50

and the mysql data
Device-Id, Device-Name, Customer-Id
SN12345, Office-Temp-Probe, JoesIceCream

and what i’d like to have is Device-Name and Customer-Id available in Influx for variables and charts. So a variable might pull the Customer-Id list so it’s there for filtering, but then of course I need that value within the query so I can put a where in there to match it.

2 Likes

Any ideas yet? I need to do the exact same thing. I have a time series query result from postgress that has device ids. I want to join it with the device_id <-> device_name info that is in a Google Sheet. How can I do the ‘join’ and use the device_name in the legend of my time series graph, (instead of device_id)?

nope, haven’t found an answer.