Clickhouse: add toStartOfWeek function

Created on 28 Jun 2016  路  2Comments  路  Source: ClickHouse/ClickHouse

Hi!

Can you add _toStartOfWeek_ function?

Behavior of this function is similar to toStartOfMonth,
but I want that function returns truncated to monday's date.

example :

toStartOfWeek(2016-06-28, 0) -> 2016-06-26
toStartOfWeek(2016-06-23, 1) -> 2016-06-20

here is first argument is a date
second argument is a first day week (sunday, monday ...)

Most helpful comment

BTW it is intentionally named toMonday, not toStartOfWeek, because there are different rules about at what day week starts.

All 2 comments

toMonday exists

BTW it is intentionally named toMonday, not toStartOfWeek, because there are different rules about at what day week starts.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

opavader picture opavader  路  3Comments

fizerkhan picture fizerkhan  路  3Comments

jangorecki picture jangorecki  路  3Comments

hatarist picture hatarist  路  3Comments

innerr picture innerr  路  3Comments