title: Mysql/ Grafana to calculate/display incremenet/ decrement of weight for the last hour/ day/ week/ month
body: <p>I have a database containing values of weights. I am seeking some kind of mysql select/function what I can use in Grafana to calculate and display: increase/ decrease of weight in the time for the last hour, for the last day, for the last week and the last month.</p>
  <p>Values are sent to the database each hour, so for each hour I have different weight. There can be increase but also decrease in the weight.</p>
  <p>Example: <br>
  ID    | weight  | timestamp <br> <br>
  6560  | 42.6    | 2021-09-02 22:00:42 <br>
  6559  | 42.3    | 2021-09-02 21:00:30 <br>
  6558  | 41.8    | 2021-09-02 20:00:15 <br>
  6557  | 41.5    | 2021-09-02 19:00:42 <br>
  .<br>
  .<br>
  .<br>
  6536  | 39.8    | 2021-09-01 22:00:51 <br><br></p>
  <p>A) last hour increase/ decrease of weight = 42.6 - 42.3 = 0.3 kg <br>
  B) last day increase/ decrease of weight = value from 2021-09-02 22:00:42 - value from record 2021-09-01 22:00:51 = 42.6 - 39.8kg = 2.8 kg <br>
  C) last week - similar but there can be used average function per day <br>
  D) last month - similar but there can be used average function per week <br></p>
  <p>Thank you for any suggestions.</p>