Joined Filtered Transposed Growth Growth Unpivot Relative T Base Query for Attaining Year Over Year Growth Selects necessary elds from LongData Nulls all zeroes Transposes data into wide format Calculates year over year growth nulling if 0 (zeroes should already be nulled) Unpivots into long format, but with growth assigned to year instead of taxable value and includes certicate year from substring of certicate Calculate year offset from start of certicate based on parcel certicate and create column for year offset Adjust SUBSTR line to proper certicate year and WHERE to proper certicate type Remove NULLIF for zeroes if zeroes are desired Add or remove years as needed based on certicate type Ranked Weighted Weight Calc Select Rank Inverse Mean Query Rank growth from highest to lowest absolute value in groupings of certicate year Calculates weighted value by dividing by 1/weight Sums weighetd growth by certicate year and divides by sum of weights Trasnposes back into wide format Ranked Medians Select Median Rank growth from highest to lowest absolute value in groupings of certicate year, additionally counts number of parcels by certiate year by year Calculates median values by averaging the output rows of the median math below. If there is an odd number of rows it average the single middle growth rate, while averaging the two middle if there is an even count. Transposes back into wide format Add MAX lines for added years Select Growth Mean Averages growth rates and re-transposes into wide format Add MAX lines for added years Add MAX lines for added years Averages by Certficiate Year Overall vs. Keep the Same Remove: Use queries as written -cert_year reference from any partition statement -cert_year from any base query in a Common Table Expression (CTE) -Remove cert_year from GROUP BY statments -Remove GROUP BY and ORDER BY from the end of the nal SELECT Year over Year Parcel Growth Sequel Queries to Determine Tax Revenue Increase due to Abatement Rolloff Prepared by David Roush, Mayoral Fellow This memo outlines three sequel queries used to attain year-over-year growth for parcels in the City of Detroit with an abatement, grouped by the type of certificate. This growth rate is intended to be used to model future growth rates between a current year and a year when a parcel is moved to the Ad Valorem tax roll, so the city is able to have more accurate projections of revenue for a certain year. Query Overview, Structure and Year Normalization The three SQL queries are 10, 9 and 7 sections of code long, with all but the last of each being a common table expression. The last is a SELECT statement that completes the overall query. The three queries calculate Rank Inverse Weighted Mean (by absolute value), Median, and Mean growth rates aggregated by parcels of a certain certificate year, with the growth rates reported by years normalized from the year a certificate was granted. These are called certificate years. For example, if a property moves to a new tax classification a year after a certificate is approved, and a select property had its certificate approved in 2013, then certificate year one for a parcel associated with that property would correspond to 2014. Nulling of Zeroes These queries were created using the Commercial Rehabilitation Act parcels, and the queries null any zeroes and any growth rates that would include a zero in order to have more accurate growth. This is done as parcels containing the value of improvement for a property with this exemption type see a large growth in taxable value due to that improvement occurring on the parcel. This dynamic likely occurs in other certificate types, but inclusion of zeroes should be individually evaluated as a new certificate type is queried. Time Window Captured The window of certificate years queried can be added or removed depending on certificate type and the window of exemptions.