> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-3a82795f.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> 時刻 `t` における計算済みの指数平滑化移動平均と `t-1` における値のうち、大きい方を返します。

# exponentialTimeDecayedMax

<div id="exponentialTimeDecayedMax">
  ## exponentialTimeDecayedMax
</div>

導入バージョン: v21.12.0

計算された指数平滑化移動平均の時刻 `t` における値と `t-1` における値のうち、大きい方を返します。

**構文**

```sql theme={null}
exponentialTimeDecayedMax(x)(value, timeunit)
```

**パラメータ**

* `x` — 半減期。 [`(U)Int*`](/ja/reference/data-types/int-uint) または [`Float*`](/ja/reference/data-types/float) または [`Decimal`](/ja/reference/data-types/decimal)

**引数**

* `value` — 値。 [`(U)Int*`](/ja/reference/data-types/int-uint) または [`Float*`](/ja/reference/data-types/float) または [`Decimal`](/ja/reference/data-types/decimal)
* `timeunit` — 時間単位。 [`(U)Int*`](/ja/reference/data-types/int-uint) または [`Float*`](/ja/reference/data-types/float) または [`Decimal`](/ja/reference/data-types/decimal) または [`DateTime`](/ja/reference/data-types/datetime) または [`DateTime64`](/ja/reference/data-types/datetime64)

**戻り値**

`t` および `t-1` における指数平滑化加重移動平均の最大値を返します。 [`Float64`](/ja/reference/data-types/float)

**例**

**視覚的な表現を用いたウィンドウ関数の使用例**

```sql title=Query theme={null}
SELECT
    value,
    time,
    round(exp_smooth, 3),
    bar(exp_smooth, 0, 5, 50) AS bar
FROM
    (
    SELECT
    (number = 0) OR (number >= 25) AS value,
    number AS time,
    exponentialTimeDecayedMax(10)(value, time) OVER (ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS exp_smooth
    FROM numbers(50)
    );
```

```response title=Response theme={null}
┌─value─┬─time─┬─round(exp_smooth, 3)─┬─bar────────┐
│     1 │    0 │                    1 │ ██████████ │
│     0 │    1 │                0.905 │ █████████  │
│     0 │    2 │                0.819 │ ████████▏  │
│     0 │    3 │                0.741 │ ███████▍   │
│     0 │    4 │                 0.67 │ ██████▋    │
│     0 │    5 │                0.607 │ ██████     │
│     0 │    6 │                0.549 │ █████▍     │
│     0 │    7 │                0.497 │ ████▉      │
│     0 │    8 │                0.449 │ ████▍      │
│     0 │    9 │                0.407 │ ████       │
│     0 │   10 │                0.368 │ ███▋       │
│     0 │   11 │                0.333 │ ███▎       │
│     0 │   12 │                0.301 │ ███        │
│     0 │   13 │                0.273 │ ██▋        │
│     0 │   14 │                0.247 │ ██▍        │
│     0 │   15 │                0.223 │ ██▏        │
│     0 │   16 │                0.202 │ ██         │
│     0 │   17 │                0.183 │ █▊         │
│     0 │   18 │                0.165 │ █▋         │
│     0 │   19 │                 0.15 │ █▍         │
│     0 │   20 │                0.135 │ █▎         │
│     0 │   21 │                0.122 │ █▏         │
│     0 │   22 │                0.111 │ █          │
│     0 │   23 │                  0.1 │ █          │
│     0 │   24 │                0.091 │ ▉          │
│     1 │   25 │                    1 │ ██████████ │
│     1 │   26 │                    1 │ ██████████ │
│     1 │   27 │                    1 │ ██████████ │
│     1 │   28 │                    1 │ ██████████ │
│     1 │   29 │                    1 │ ██████████ │
│     1 │   30 │                    1 │ ██████████ │
│     1 │   31 │                    1 │ ██████████ │
│     1 │   32 │                    1 │ ██████████ │
│     1 │   33 │                    1 │ ██████████ │
│     1 │   34 │                    1 │ ██████████ │
│     1 │   35 │                    1 │ ██████████ │
│     1 │   36 │                    1 │ ██████████ │
│     1 │   37 │                    1 │ ██████████ │
│     1 │   38 │                    1 │ ██████████ │
│     1 │   39 │                    1 │ ██████████ │
│     1 │   40 │                    1 │ ██████████ │
│     1 │   41 │                    1 │ ██████████ │
│     1 │   42 │                    1 │ ██████████ │
│     1 │   43 │                    1 │ ██████████ │
│     1 │   44 │                    1 │ ██████████ │
│     1 │   45 │                    1 │ ██████████ │
│     1 │   46 │                    1 │ ██████████ │
│     1 │   47 │                    1 │ ██████████ │
│     1 │   48 │                    1 │ ██████████ │
│     1 │   49 │                    1 │ ██████████ │
└───────┴──────┴──────────────────────┴────────────┘
```
