Quantcast
Channel: SCN : Unanswered Discussions - Data Services and Data Quality
Viewing all articles
Browse latest Browse all 3719

Issue in populating Aggregate Table

$
0
0

Hello Experts,

 

I have a requirement where i have to find the peak hour of a particular reading. My source has around  5 million records for one month. My driving table stores reading at hourly grain. I need to built a aggregate table which would at day grain and not hourly. This can easily be achieved my using sum and group by .  Again i need to find the peak demand of a transformer and a peak demand hour. A big catch is that my source driving table has couple of columns where the readings are stored(in different units). If suppose we have a reading in 'Unit1' that does not mean it would necessarily have a reading in 'Unit2' column as well. Below is structure of my driving table and my aggregate table.

DRIVING TABLE:

  Reading_Unit1   Reading_Unit2  Reading_hour   reading_dt

0.5                          1.2                             01                    01/01/2015 01:15:39

0.7                          1.6                             16                    01/01/2015 16:23:56

1.2                          0                                23                    01/01/2015 23:47:43

2.5                          0                                06                    02/01/2015 06:15:34       

1.7                          0                                14                    02/012015 14:25:08

0                             1.5                              01                   01/01/2015 01:38:34

0                             1.7                              09                   01/01/2015 09:05:58

0                             0.6                              17                   02/01/2015 17:06:52

 

Aggregate TABLE: Day grain and not hourly grain as compared to the fact table.


Peak_reading       Peak readingUnit2            Peak_Hour_Unit1    Peak_hour_unit2     Date

Unit1

0.7                                       1.6                                  16                                    01                01/01/2015

2.5                                        0                                    06                                    06                01/01/2015

0                                         1.7                                   09                                    09                01/01/2015

0                                         0.6                                    17                                    17               02/01/2015

 

 

Peak value is the max value of the reading on a particular day. How do i calculate the Peak Hour values for both the units. I had initially used a look_up_ext function. But my source has huge record count (almost  5 million for just one month). So the job keeps on running for ages. Do we have an alternative to this?

 

I am able to achieve this by using the Dense Rank Keep First functionality using raw sql queries. But unable to find an alternative in BODS.

 

Regards,

Ankit


Viewing all articles
Browse latest Browse all 3719

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>