por TotallySQL - Tipo de produto: Componente / Classe .NET / Código 100% gerenciado
Compute running totals, moving averages, and many other statistics that need relative row references, within T-SQL queries. SQLRollingStats is a solution for SQL Server that extends and enhances your T-SQL programming environment by adding 30+ statistical window functions - allowing the computation of results per row that depend on values in other rows. All functions are capable of taking into account all rows so far processed, or just the last n rows where n is the specified window size. Functions include: sum, product, maximum, minimum, range, mid-range, first (in sequence), nth previous, average (mean), variance (sample & population), standard deviation (sample & population), geometric mean, harmonic mean, quadratic mean, median, quartile, inter-quartile range, tri-mean, percentile, percentile rank, exponential average (mean), exponential variance, exponential standard deviation, weighted average, weighted variance (sample & population), weighted standard deviation (sample & population), weighted power mean.
Easy to Use
All SQLRollingStats functions are implemented as types: you need only declare a variable of the appropriate type, assign it a starting value (usually '0') and then call its Result() method in your queries using the syntax @variable.Result(), specifying the input values and a row-number (since almost all forms of rolling statistics are only valid when processed in a given order). T-SQL's built-in ROW_NUMBER() function will usually suffice for the purpose - see the examples given in the Product Documentation for more details.
Support for Tiling
Just as the built-in T-SQL ranking functions such as ROW_NUMBER() support tiling (the ability to group results into distinct blocks and re-start the calculation from scratch at the start of each block) using the PARTITION BY clause, so do the SQLRollingStats functions - so you can in a single query calculate rolling statistics across a number of different domains.
Outstanding Performance and Numerical Accuracy
The algorithms behind the SQLRollingStats functions use industry-proven, best-in-class techniques devised by some of the world's leading numerical computing experts to maximise performance and accuracy even for fairly extreme input values. Careful heuristics and edge-case checks through the code ensure that problems caused by the limitations of floating-point arithmetic on digital computers (such as cancellation errors) are kept to an absolute mininum, and a broad range of special-purpose, high-performance numerical computing approaches are used in place of the slow, expensive computations that would result from 'naive' implementations of the underlying mathematics.