I need to create a view in sql which takes data from other table,it has a column as closing balance from which totalassetvalue(TAV) is to be calculated in the view itself, then this totalassetvalue will be used to calculate average total asset value based on QTD.
(For example if there are transactions happened in mar , june , sept and dec then first I need to take the average of TAV of dec and sept then sept and june then june and mar then mar and last year dec. and so on)
Then I need to put the values in the average TAV column
For future reference, please follow the guidelines here:
We'd need table schema, sample data, and expected results. I'm assuming QTD means "quarter to date", but it would help if you defined all your acronyms like you did with TAV. Also, for completeness sake, include the date boundaries for your quarters as well.
This will absolutely need an example/better definition, I'm struggling to understand it due to lack of punctuation.