Help to convert influx ql to flux in grafana

Hy,

I need your help to convert query inflxu ql to query flux.

Actually i have this :

It’s Works, but the temperature show example 1589° Instead of 15,89°

In influx ql language, it’s Easy to /100

How /100 température in flux language.

Thanks

Ps : sorry for my bad english, i’m french

i search and i find how /100, but now i have 2 jauge, how see only 1 jauge /100 ?

Maybe try changing the last line of the function to this?
Essayez de changer la dernière ligne

 |> map(fn: (r) => ({r with _value: r._value / 100}))

thanks for your help but it doesn’t work, i see only 1 jauge 2731 insted of 27.31

How about this?

from(bucket: "Nodered")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r._measurement == "PoolMaster" and r._field == "Tmp")
  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
  |> map(fn: (r) => ({r with Temperature: r._value / 100}))
  |> yield(name: "Temperature")
  |> keep(columns: ["Temperature"])

it’s make an error : invalid: runtime error @5:6-5:60: map: type conflict: int != float

Try changing the 100 to 100.0 in the row:

 |> map(fn: (r) => ({r with Temperature: r._value / 100.0}))

it’s make this :

if i select other “fields” (on the right) than “numeric fields” i have no data on jauge.

OK, I think this should work…

from(bucket: "Nodered")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r._measurement == "PoolMaster" and r._field == "Tmp")
  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
  |> map(fn: (r) => ({r with _value: float(v: r._value) / 100.0} ))
1 Like

It’s make same that last picture :confused:

peux tu nous donner data examplaire? CSV

recordedtime,tmp
2022-06-15 04:00:00.000,1.364
2022-06-12 04:00:00.000,0.572
2022-06-15 17:00:00.000,1.507
2022-06-10 02:00:00.000,0.022
2022-06-14 07:00:00.000,1.133

In influx db 2;0, i find that you ask

Thanks for your help !

pas permit au EU. copy paste ici le data dans le link.
C’est ce que je t’ais demander, pas un link mais le data

pas un photo. csv data

recordedtime,tmp
2022-06-15 04:00:00.000,1.364
2022-06-12 04:00:00.000,0.572
2022-06-15 17:00:00.000,1.507
2022-06-10 02:00:00.000,0.022
2022-06-14 07:00:00.000,1.133

Ok i understand, sorry

#group,false,false,true,true,false,false,true,true
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string
#default,mean,
,result,table,_start,_stop,_time,_value,_field,_measurement
,0,2022-06-16T17:52:38.77602043Z,2022-06-16T18:52:38.77602043Z,2022-06-16T17:52:50Z,2828,Tmp,PoolMaster
,0,2022-06-16T17:52:38.77602043Z,2022-06-16T18:52:38.77602043Z,2022-06-16T17:53:20Z,2829,Tmp,PoolMaster
,0,2022-06-16T17:52:38.77602043Z,2022-06-16T18:52:38.77602043Z,2022-06-16T17:53:50Z,2830,Tmp,PoolMaster
,0,2022-06-16T17:52:38.77602043Z,2022-06-16T18:52:38.77602043Z,2022-06-16T17:54:20Z,2830,Tmp,PoolMaster
,0,2022-06-16T17:52:38.77602043Z,2022-06-16T18:52:38.77602043Z,2022-06-16T17:54:50Z,2830,Tmp,PoolMaster
,0,2022-06-16T17:52:38.77602043Z,2022-06-16T18:52:38.77602043Z,2022-06-16T17:55:20Z,2831,Tmp,PoolMaster
,0,2022-06-16T17:52:38.77602043Z,2022-06-16T18:52:38.77602043Z,2022-06-16T17:55:50Z,2830,Tmp,PoolMaster
,0,2022-06-16T17:52:38.77602043Z,2022-06-16T18:52:38.77602043Z,2022-06-16T17:56:20Z,2831,Tmp,PoolMaster
,0,2022-06-16T17:52:38.77602043Z,2022-06-16T18:52:38.77602043Z,2022-06-16T17:56:50Z,2830,Tmp,PoolMaster
,0,2022-06-16T17:52:38.77602043Z,2022-06-16T18:52:38.77602043Z,2022-06-16T17:57:20Z,2830,Tmp,PoolMaster
,0,2022-06-16T17:52:38.77602043Z,2022-06-16T18:52:38.77602043Z,2022-06-16T17:57:50Z,2828,Tmp,PoolMaster
,0,2022-06-16T17:52:38.77602043Z,2022-06-16T18:52:38.77602043Z,2022-06-16T17:58:20Z,2831,Tmp,PoolMaster
,0,2022-06-16T17:52:38.77602043Z,2022-06-16T18:52:38.77602043Z,2022-06-16T17:58:50Z,2831,Tmp,PoolMaster
,0,2022-06-16T17:52:38.77602043Z,2022-06-16T18:52:38.77602043Z,2022-06-16T17:59:20Z,2831,Tmp,PoolMaster
,0,2022-06-16T17:52:38.77602043Z,2022-06-16T18:52:38.77602043Z,2022-06-16T17:59:50Z,2830,Tmp,PoolMaster
,0,2022-06-16T17:52:38.77602043Z,2022-06-16T18:52:38.77602043Z,2022-06-16T18:00:20Z,2830,Tmp,PoolMaster
,0,2022-06-16T17:52:38.77602043Z,2022-06-16T18:52:38.77602043Z,2022-06-16T18:00:50Z,2830,Tmp,PoolMaster
,0,2022-06-16T17:52:38.77602043Z,2022-06-16T18:52:38.77602043Z,2022-06-16T18:01:20Z,2830,Tmp,PoolMaster

Comment veux tu que je te donne le .csv autrement qu’en l’hébergeant quelque part ? (Comme fait précédemment sur uptobox)

https://products.aspose.app/cells/viewer/view?FolderName=16c13684-d923-4f86-9846-d9ea24a3af9e&FileName=2022-06-16-20-52_influxdb_data.csv&Uid=95fe5b98-747d-4499-8afc-f8a3e35da600.xlsx

Like this ?
result,table,_start,_stop,_time,_value,_field,_measurement

,0,2022-06-16T17:52:38.77602043Z,2022-06-16T18:52:38.77602043Z,2022-06-16T17:52:50Z,2828,Tmp,PoolMaster

,0,2022-06-16T17:52:38.77602043Z,2022-06-16T18:52:38.77602043Z,2022-06-16T17:53:20Z,2829,Tmp,PoolMaster

,0,2022-06-16T17:52:38.77602043Z,2022-06-16T18:52:38.77602043Z,2022-06-16T17:53:50Z,2830,Tmp,PoolMaster

,0,2022-06-16T17:52:38.77602043Z,2022-06-16T18:52:38.77602043Z,2022-06-16T17:54:20Z,2830,Tmp,PoolMaster

,0,2022-06-16T17:52:38.77602043Z,2022-06-16T18:52:38.77602043Z,2022-06-16T17:54:50Z,2830,Tmp,PoolMaster

,0,2022-06-16T17:52:38.77602043Z,2022-06-16T18:52:38.77602043Z,2022-06-16T17:55:20Z,2831,Tmp,PoolMaster

,0,2022-06-16T17:52:38.77602043Z,2022-06-16T18:52:38.77602043Z,2022-06-16T17:55:50Z,2830,Tmp,PoolMaster

,0,2022-06-16T17:52:38.77602043Z,2022-06-16T18:52:38.77602043Z,2022-06-16T17:56:20Z,2831,Tmp,PoolMaster

Or this :slight_smile:

2022-06-16T17:52:50Z,2828
2022-06-16T17:53:20Z,2829
2022-06-16T17:53:50Z,2830
2022-06-16T17:54:20Z,2830

What’s your value option ?

Pas un link

time,Tmp
2022-06-16T17:52:50Z,2828	
2022-06-16T17:53:20Z,2829	

tres simple, tous le data

1 Like

You have 2 readings in the same day different times.Which reading do you want ? This is why it is vital to provide sample data.

1 Like

From the last screenshot by @yosiasz , it appears my flux query worked in that it converted the original value (divided by 100) and only displayed the converted value. Did I miss something?

1 Like

thanks a lot for you help, it’s work, maybe i’m make a mistake when i copy

Yosiasz : Thanks a lot for your help, it’s Work fine !

I mesured a water température, on mqtt protocol She send regulary value to update