0 - 3 of 3 tags for analytical

Hi All,
 
I have the below requirement.
 
Incoming data

ID  Status         Start Date

1   Active              7-Aug 

1   Suspended     8-Aug 

1   Active              9-Aug 

1   Active             10-Aug 

1   Suspended     11-Aug 
 
I should get the below output.

Hi,
please check the following dataset
customerid  purchasedate 
1                      5/9/2013
1                      5/20/2013   
1                       5/29/2013
2                       6/8/2013
 
I need to calculate resultset like

Hi everybody,
Could anybody tell me how TD analytical functions are implemented under the hub?