# Calculated field

**URL:** <https://community.influxdata.com/t/calculated-field/25011>\
**Category:** InfluxDB 2\
**Tags:** influxdb, flux\
**Created:** [May 12, 2022, 10:03am UTC](https://community.influxdata.com/t/calculated-field/25011 "2022-05-12T10:03:08Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Juan\_Alonso\_Pla](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/juan_alonso_pla/32/9659_2.png) [@Juan\_Alonso\_Pla](https://community.influxdata.com/u/Juan_Alonso_Pla)\
**Post date:** [May 12, 2022, 1:25pm UTC](https://community.influxdata.com/t/calculated-field/25011/2 "2022-05-12T13:25:08Z")

</div>

Hello @Mayelle26,

You can do this with the function map():

> |\> map(
> 
> ```
> fn: (r) => ({
> 
> r with
> 
> calculation: 0.2831 * r.rh_column ^ (0.2735 * float(v:r.temp_column)) + 0.0003018 * r.rh_column^ 2.0 + 0.01289 * r.rh_column- 4.0962
> 
> })
> 
> ```
> 
> )

You can find a similar topic here:

> [@Multiply two field values and store the result in a new field](https://community.influxdata.com/t/multiply-two-field-values-and-store-the-result-in-a-new-field/11951):
>
> I’m logging voltage and current of electric appliances (eg. lights) in my use case, the idea being I’d like to calculate the daily energy consumption. Following are the concerns: How do I multiply voltage and current of each data point, and store it in a new field (Power) Let’s say the frequency of data collection is 5 minutes. How do I calculate the time difference (in minutes) between two successive data points? This would enable me to multiply power with time, and store the result as a new …

---

_[View the full topic](https://community.influxdata.com/t/calculated-field/25011)._
