For NTile functions, the expected behavior is to have the ranges calculated from 0 to the maximum in the range of values. This is not the case. The NTileValue function actually uses the minimum and maximum of the range of values in the calculation.
Here are the settings for the NTileValue function.
NTileValue: Ascending = True, Segments = 4, BreakBy = {}(Argument)
The NTileValue function calculates on ranges, but it segments them by the maximum and minimum range of the values. The range is not calculated from 0 to the Maximum as may be expected. Imagine the data is as follows:
|
|
|
|
|
|
|
If the user sets the NTileValue function as follows, the breakdown of the segments will be calculated as shown below:
NTileValue: Ascending = True, Segments = 4, BreakBy{}(Values)
The segment ranges are calculated as follows:
(Max - Min) / Segment # = Segment Range
(10 - 4)/4 = 1.5
Ranges:
The data would be separated as follows:
To read more about the NTileValue function please refer to the "Analytical Functions Reference."