NTile

Returns a division number of a tuple in a set. This function only applies to aggregate storage databases.

Syntax

NTile ( member_or_tuple, set, number_of_divisions, numeric_value_expr )
ParameterDescription

member_or_tuple

A member or a tuple.

set

The set to order.

number_of_divisions

The number of divisions to use in ordering the set.

numeric_value_expr

A numeric value or an expression that returns a numeric value.

Notes

Example

WITH
MEMBER [Measures].[7tile] AS
  'Ntile 
     ([Measures].[Price Paid],
    { [Products].Levels(0).Members },
      7,
    [Measures].[Price Paid]
  )'
SELECT
{ [Measures].[Price Paid], [Measures].[7tile] } on columns,
{ [Products].Levels(0).Members } on rows
FROM ASOSamp.Sample