Null Values in Sorting Rules

For standard attributes, null values are handled identically for all data types. For dynamic attributes, you can configure whether you want a null value to be interpreted as a minimum, maximum, or average value using the dynamic attribute Default Value option.

Standard Attributes

If a sorting rule is based on a standard attribute, then null values are always added to the end of the result set, independent of the sorting direction.

For example, ascending values are sorted as:

1

2

3

null

null

Descending values are sorted as:

3

2

1

null

null

Dynamic Attributes

You can control how null values are sorted in dynamic attributes by setting the Default Value for the attribute. If you select minimum, null values are sorted to the end of the result set, similar to the default behavior for standard attributes. If you select average, then the value is sorted to the middle of the result set, as though the value was average of all values. This is useful if you have incomplete data for some products, but do not want a null value to automatically cause the product to be sorted to the end of the result set. If you select maximum, then null values are sorted to the beginning of the result set. This is useful if you have new products with incomplete data, such as sales figures, that you want to promote.