Jump to content

To Add values of HoH by day, hour and minute


seafree

Recommended Posts

HI good morning, I have been use a multidimensional Hash of Hashes but I have been could't  continue, please could you help me?

The data are by date, hour and minute, and it have  a value:

Actually I  access the data from postgresql database:


2023-01-01(
         00:00=> 120
         00:03=>50
         .....
         23:57=> 320562.90)

2023-01-02(
         00:01=>401
         00:02=> 802
         00:03=> 1203
         .......
        23:57=> 320562.69
        23:58=> 342514.68
.
.
The user input a date range and have been get a HoH showed,  however I need generate average between the dates input by the users.

For example,  I must get the average of 2023-01-01 23:57=> 320562.90 and 2023-01-02 23:57=> 320562.69

I has been use the next reference but I can`t  get the result :
https://stackoverflow.com/questions/38448714/how-to-add-multiple-values-from-multiple-hashes-with-same-key-perl


Please, any body please help me.

Regards
 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...