# Creating a measurement with two separate columns in influxdb

**URL:** <https://discourse.nodered.org/t/creating-a-measurement-with-two-separate-columns-in-influxdb/74454>\
**Category:** General\
**Created:** [30 January 2023 23:59 UTC](https://discourse.nodered.org/t/creating-a-measurement-with-two-separate-columns-in-influxdb/74454 "2023-01-30T23:59:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohamed](https://avatars.discourse-cdn.com/v4/letter/m/d78d45/32.png) [@mohamed](https://discourse.nodered.org/u/mohamed)\
**Post date:** [30 January 2023 23:59 UTC](https://discourse.nodered.org/t/creating-a-measurement-with-two-separate-columns-in-influxdb/74454/1 "2023-01-30T23:59:12Z")

</div>

Hello guys , I'm kind new to NodeRed, so pardon me if this question seems obvious.  
I'm pushing data from many sensors to a mosquitto broker. This data is stored in an influxDB database. This is my NodeRed flow and debug message like:

 ![Capture](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/b/6ba7f07caa89180fd1992f5755e66262815c0f2c.png)  
 ![Capture2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/d/1d0742f6d071d4f6ecc12e324f5fdeb9cbc68f1d.png)  
Now, i want to create a new measurement "table" in InfluxDB with voltage and current in two separate columns "in the same measurement", how can this be achieved?!

---

<div class="post-metadata">

**Author:** ![FeliceM](https://avatars.discourse-cdn.com/v4/letter/f/ec9cab/32.png) [@FeliceM](https://discourse.nodered.org/u/FeliceM)\
**Post date:** [31 January 2023 02:46 UTC](https://discourse.nodered.org/t/creating-a-measurement-with-two-separate-columns-in-influxdb/74454/2 "2023-01-31T02:46:21Z")

</div>

It is not clear if you are recreating a measurement (table) for each temp/current in Influxdb.  
There would been reason to do so. A better way is to eventually create one table for each sensor simply connecting one influxDB node directly to the output of your JSON node.

---

<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:** [31 January 2023 09:41 UTC](https://discourse.nodered.org/t/creating-a-measurement-with-two-separate-columns-in-influxdb/74454/3 "2023-01-31T09:41:48Z")

</div>

The usual way to record data like that would be to put the temperature data from all sensors into one measurement, with the temperature as a field and the id as a tag, to put all the voltage/current data into another measurement with voltage and current as fields, and the id as a tag, and to put the illuminance data into a third measurement, in the same way.

---

<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:** [1 April 2023 09:42 UTC](https://discourse.nodered.org/t/creating-a-measurement-with-two-separate-columns-in-influxdb/74454/4 "2023-04-01T09:42:11Z")

</div>

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