The Wikipedia definition of Standard Deviation is…Ī measure that is used to quantify the amount of variation or dispersion of a set of data values. To do this was can obviously use the AVG function to get an average quantity but then how far either side of that value do we allow through our filter? Enter Standard Deviation Another better option for our scenario is to work out what a normal range is and filter out values that fall outside of that range. One approach would be to sort by quantity and filter out the bottom and top X% to remove the outliers this however will not be very accurate as it will remove data that falls inside normal stocking quantities and possibly leave values in that fall outside the normal range.
![mssql weighted standard deviation mssql weighted standard deviation](http://c3154802.r2.cf0.rackcdn.com/article_images_2014/time_series_files/image001.jpg)
In this case we need to find the outliers (values that fall outside of the norm) and filter them out of our reports. There are a few ways we could handle this possibly the simplest would be to filter out quantities going to a new warehouse as part of it’s initial stock but for the sake of this example lets pretend that’s not an option. This particular report is used to predict lines coming in any any given day and is not interested in the opening of new warehouses, the dataset will throw these values out by including the quantities when fully stocking a warehouse from scratch. Then lets imagine that a few times a year company X opens a new warehouse and fully stocks it. When running aggregations for reporting in some situations outliers can throw out the numbers.įor example lets say we have a report that shows the quantity of stock lines delivered to the the many warehouses of company X per day.