**Describe the unexpected behaviour**
It's not possible to calculate min and max values for range dictionary via EXPRESSION

**How to reproduce**
ClickHouse version 21.11

```
CREATE TABLE test_range_dict
(
    `id` UInt32,
    `date` Date,
    `start` Date,
    `end` Date
)
ENGINE = Memory

CREATE DICTIONARY IF NOT EXISTS test_range_dict_d
(
    `id` UInt64,
    `date` Date,
    `start` Date,
    `end` Date,
    `start_date` Date EXPRESSION date - toIntervalDay(1),
    `end_date` Date EXPRESSION any(date) OVER (PARTITION BY id ORDER BY date ASC Rows BETWEEN 1 PRECEDING AND 1 PRECEDING)
)
PRIMARY KEY id
SOURCE(CLICKHOUSE(TABLE 'test_range_dict'))
LIFETIME(MIN 0 MAX 120)
LAYOUT(RANGE_HASHED())
RANGE(MIN start MAX end)

Ok.

0 rows in set. Elapsed: 0.006 sec.


SELECT *
FROM test_range_dict_d

Ok.

0 rows in set. Elapsed: 0.011 sec.


DROP DICTIONARY  test_range_dict_d;

CREATE DICTIONARY IF NOT EXISTS test_range_dict_d
(
    `id` UInt64,
    `date` Date,
    `start` Date,
    `end` Date,
    `start_date` Date EXPRESSION date - toIntervalDay(1),
    `end_date` Date EXPRESSION any(date) OVER (PARTITION BY id ORDER BY date ASC Rows BETWEEN 1 PRECEDING AND 1 PRECEDING)
)
PRIMARY KEY id
SOURCE(CLICKHOUSE(TABLE 'test_range_dict'))
LIFETIME(MIN 0 MAX 120)
LAYOUT(RANGE_HASHED())
RANGE(MIN start_date MAX end_date)


Ok.

0 rows in set. Elapsed: 0.008 sec.


SELECT *
FROM test_range_dict_d


0 rows in set. Elapsed: 0.002 sec.

Received exception from server (version 21.11.1):
Code: 47. DB::Exception: Received from localhost:9000. DB::Exception: Missing columns: 'end_date' 'start_date' while processing query: 'SELECT id, start_date, end_date, date, start, end FROM default.test_range_dict', required columns: 'start_date' 'id' 'end' 'end_date' 'start' 'date', maybe you meant: ['id','end','start','date']. (UNKNOWN_IDENTIFIER)
```

**Expected behavior**
Dictionary works

AutoPtr<Document> doc,
    AutoPtr<Element> root,
    const ASTDictionaryAttributeDeclaration * dict_attr)
{
    AutoPtr<Element> attribute_element(doc->createElement("attribute"));
    root->appendChild(attribute_element);
    AutoPtr<Element> name_element(doc->createElement("name"));
    AutoPtr<Text> name(doc->createTextNode(dict_attr->name));
    name_element->appendChild(name);
    attribute_element->appendChild(name_element);
    AutoPtr<Element> type_element(doc->createElement("type"));
    AutoPtr<Text> type(doc->createTextNode(queryToString(dict_attr->type)));
    type_element->appendChild(type);
    attribute_element->appendChild(type_element);
    AutoPtr<Element> null_value_element(doc->createElement("null_value"));
    String null_value_str;
    if (dict_attr->default_value)
        null_value_str = getFieldAsString(dict_attr->default_value->as<ASTLiteral>()->value);
    AutoPtr<Text> null_value(doc->createTextNode(null_value_str));
    null_value_element->appendChild(null_value);
    attribute_element->appendChild(null_value_element);
    buildAttributeExpressionIfNeeded(doc, attribute_element, dict_attr);
    if (dict_attr->hierarchical)
    {
        AutoPtr<Element> hierarchical_element(doc->createElement("hierarchical"));
        AutoPtr<Text> hierarchical(doc->createTextNode("true"));
        hierarchical_element->appendChild(hierarchical);
        attribute_element->appendChild(hierarchical_element);
    }
    if (dict_attr->injective)