Ranking based on an Indicator
This is how my input data looks like:
Date Indicator
10/01/2008 03:00:00 AM 0
10/01/2008 06:00:00 AM 1
10/01/2008 07:00:00 AM 0
10/01/2008 08:00:00 AM 1
11/01/2008 03:00:00 AM 1
11/01/2008 06:00:00 AM 1
11/01/2008 07:00:00 AM 0
11/01/2008 08:00:00 AM 1
Output I want is:
Date Rank
10/01/2008 03:00:00 AM 1
10/01/2008 06:00:00 AM 2
10/01/2008 07:00:00 AM 3
10/01/2008 08:00:00 AM 4
11/01/2008 03:00:00 AM null
11/01/2008 06:00:00 AM null
11/01/2008 07:00:00 AM 1
11/01/2008 08:00:00 AM 2
What I want to do is start ranking depending on the day & time and when the indicator is zero. In the 10/01 example my value in the first indicator field is 0 and so I start ranking right away, but in the 11/01 example my 3rd row has the value of 0 so my first 2 rows will have no rank.
Thank you..