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

Process previous row

$
0
0

Hi everyone,

 

 

I have the following input :

 

IDValueDate

B537D

540013-10-2014 12:00:00:00000

2H45P

550013-10-2014 13:00:00:00000

V5JS2

5800
13-10-2014 14:00:00:00000
...........

 

This input is sorted.

 

My goal is to retrieve the difference between actual value and previous hour value.

For exemple, for the second line, i would like to have the following output :

 

IDValueDateDifference
B537D540013-10-2014 12:00:00:00000***
2H45P550013-10-2014 13:00:00:00000100
V5JS2580013-10-2014 14:00:00:00000300

 

How can i proceed to get the following threatment : value of the processed column minus the value of the previous hour.

 

My second aim is to propose an aggregate on a daily basis, but there's a trick : my day start at 10 AM and ends at 5AM the next days.

I'm thinking about defining variables but nothing specific.

 

Any help would be greatly appreciated.

 

Guillaume


Viewing all articles
Browse latest Browse all 3719

Trending Articles



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