Read value of an Attribute at two different time stamps

Hello experts, I have a unique requirement, Variable “A” is storing the value in the database at every seconds. Now i need to read the value of Variable “A” from the database at two different time stamp  for example :  Variable “A” value = 50 at  T0 minutes                          Variable “B” value = 100 at  T15 minutes next instance                   read the variable value A at T16 minutes                  read the variable value A at T30 minutes So for every 15 minutes duration i need to read the value of the variable .   Thanks for your support in advance   
1 answers

I don’t see a question? How I would do this is:

- create a scheduled event that runs every needed x seconds. Also create an entity with three attributes: 

  1. ID: autonumber
  2. Timestamp: DateTime
  3. Value: String


in this scheduled event create and commit an object of this type with setting its value and the CurrentDate as Timestamp.

- create your own logic by retrieving the correct list of objects from database to compare the different objects by its timestamp or retrieve the last x of them with the help of the auto number field and sorting