0 - 4 of 4 tags for Analytical Window Function

I'm trying to find the sum of amount for an 'ID' trailing 365 days from the 'DT'. Below is a sample from the data I'm working on. The below table consists of dates when purchase was made , id and the amount. I wanted to calculate amount spent by an id trailing 365 days from the 'DT'. Any help on this will be appreciated. Thanks.

Hi everyone,

I was hoping that some one could help me create a SQL to deduce the following result.

We are trying to roll up multiple roles into a single role.


Below is the example of the roles currently defined for the two users -


Hi - I've seen some posts here regarding the SUM OVER function to calculate the cumulative sum.  My problem at hand is slightly different, where I need to keep a running total of distinct purchasers by year:
Year        #Distinct Customers         #Cumulative (Distinct Customers)

Hi All ,
I need to remove only the Immediate duplicates if there is no change in some specific columns.
Incomming Data:
1       A           S1         Oct-1
1       A           S3         Oct-2