How do I calculate a consumption? (substraction of different record values)

Hi,

I have an object named electricity meter with two fields:
Time (datetime) and Value (number).
Every 15 minutes the total amount of my electrcity meter is added to my object like this:

Date                             Value
2018-10-20 10:00        105
2018-10-20 10.15        111
2018-10-20 10.30        120

Question: How can I calculate the consumption per every new record?

In my example the first consumption result would need to be 6 (111-105) and the second consumption result would Need to be 9 (120-111). 

Im thankful for every suggestion that could help me to solve this.

Many thanks
Kim

 

 

 

 

 

Hello Kim ,

 

Not poosible using knack inbuilt feature but can be done using javascript functionality .

 

Making somekind of loop which run on older records as well .

 

Regards,

Sunny Singla

ssingla1985@gmail.com

Hello Sunny,

 

thanks for your answere.

Your solution make sense and I actually thought About it already.

However I was not able to make it work in the Knack builder and find the Right feature.

Do you know if there is a Kanack feature how to automatically Import the previous value when creating a new record?

 

I actually tried using Zapier to create a trigger. The problem here is that triggers only work when new records are entered in the Knack live app.

 

BR

Kim 

 

 

 

Hello Kim,

 

 

This can be possible by creating a Services and Schedule it in server . Which get last record value in separate column .

 

And Subtract previous column with new column using formula field .

 

Like 

 

Also you can use your previous method "Use to insert records after every 15 min" 

 

Regards,

Sunny Singla

ssingla1985@gmail.com 

Hi Julian,

sorry for my late Reply.

No, I havent been able to solve this Problem and even the Knack Team says this is a tricky one and could not help me.

To answere your Question. At this Point Im still adding each record manually whereas my plan for the future is to Import the records from a spead sheet.

If you have any idea how to solve this would be great.

Thanks a Million and BR
Kim

 

Kim, 

Did you ever solve this problem? If not, what method are you using to add each record every 15 minutes?