Joinutility seperatorLogin utility separator Infobright.com
   
 
Newbie Question
Posted: 17 December 2010 04:28 PM   Ignore ]  
Newbie
Rank
Total Posts:  1
Joined  2010-12-06

Hello:

I have a CSV file with 2 columns and several million rows like this:

Date/Time           Price
12/22/10 23:59:58, 15.01
12/23/10 00:00:01, 15.45
12/23/10 00:00:03, 15.64
12/23/10 00:00:07, 16.04
12/23/10 00:00:11, 15.04
12/23/10 00:00:20, 15.64
12/23/10 00:00:22, 15.23

I have another CSV file with 5 columns and 1 row per hour with the open, high, low and close prices of the hourly periods:

Date/Time         Open   High   Low Close
12/22/10 23:00:00, 15.23,15.45,14.78,15.01
12/23/10 00:00:00, 15.45,16.72,14.95,15.38
12/22/10 23:00:00, 15.38,15.78,15.03,15.12

I need to add some columns with different operation results like these:

As an example of the operations to be done….: The expected result is as follow:

Date/Time         Price 3-Average 3-Median (Hourly High)-Price
12/22/10 23:59:58, 15.01,      Null,      Null,              0.44
12/23/10 00:00:01, 15.45,      Null,      Null,              1.27
12/23/10 00:00:03, 15.64,      Null,      Null,              1.08
12/23/10 00:00:07, 16.04,    15.37,    15.45,            0.68
12/23/10 00:00:11, 15.04,    15.71,    15.64,            1.68
12/23/10 00:00:20, 15.64,    15.24,    15.04,            1.08
12/23/10 00:00:22, 15.23,    15.24,    15.04,            1.49

Do you think this application is a good fit for Infobright?

Cheers

Francisco

Profile
 
Posted: 18 December 2010 02:59 AM   Ignore ]   [ # 1 ]  
Sr. Member
Avatar
RankRankRankRank
Total Posts:  763
Joined  2008-08-18

Hi,

It’s hard to write an efficient SQL query to calculate e.g. an average of last 3 values. I would not use SQL-driven database at all, rather a spreadsheet or a statistical suite.

Regards,

Signature 
Profile