# How to write 4 values with with calculated times in InfluxDB?

**URL:** <https://discourse.nodered.org/t/how-to-write-4-values-with-with-calculated-times-in-influxdb/82053>\
**Category:** General\
**Created:** [15 October 2023 15:23 UTC](https://discourse.nodered.org/t/how-to-write-4-values-with-with-calculated-times-in-influxdb/82053 "2023-10-15T15:23:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![oliverr](https://avatars.discourse-cdn.com/v4/letter/o/ce73a5/32.png) [@oliverr](https://discourse.nodered.org/u/oliverr)\
**Post date:** [15 October 2023 15:23 UTC](https://discourse.nodered.org/t/how-to-write-4-values-with-with-calculated-times-in-influxdb/82053/1 "2023-10-15T15:23:48Z")

</div>

Hi,

I get via mqtt every 20 minutes a record and in the record are 4 values, which are values of each 5 minutes distance.  
These values are then to be written into an influxdb as if they were written into the influxdb at intervals of 5 minutes.  
I get the four values separately and also the times I get calculated, but how do I get each value with the calculated time, in the influxdb, so that the 4 values are not written to the InfluxDB with an equal time and that later the grafana analysis can work with it normally?

> uplink\_time: "2023-10-15T14:49:53.766173993Z"  
> wert\_4: 20009602  
> wert\_3: 20009582  
> wert\_2: 20009564  
> wert\_1: 20009544

Thanks,  
Oliver

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [15 October 2023 15:49 UTC](https://discourse.nodered.org/t/how-to-write-4-values-with-with-calculated-times-in-influxdb/82053/2 "2023-10-15T15:49:27Z")

</div>

You can specify the time by writing the time value you want (in whatever time units you have specified in the influxdb out node's config, I think) by providing a `time` field value.

In the example data, what time values do you want for the four values? Are the values all for the same thing in the real world?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [14 December 2023 15:49 UTC](https://discourse.nodered.org/t/how-to-write-4-values-with-with-calculated-times-in-influxdb/82053/3 "2023-12-14T15:49:49Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
