> ## Documentation Index
> Fetch the complete documentation index at: https://docs.engrate.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Conditions

> Available Conditions

Conditions are used by operations like [Select](/api-reference/cost-of-energy/functions/select) and [Mask](/api-reference/cost-of-energy/functions/mask) to define when the operation applies.

Conditions are represented as a [tagged union](https://en.wikipedia.org/wiki/Tagged_union), using the field `type` which every condition contains.
Anywhere a condition is accepted you may find any of the conditions listed here, and you tell them apart using the value of the `type` field.

### Time conditions

| Condition                                                                    | Tag                | Description                                          |
| ---------------------------------------------------------------------------- | ------------------ | ---------------------------------------------------- |
| [Month](/api-reference/cost-of-energy/conditions/month)                      | `month`            | Only applies in the specified months.                |
| [DayOfWeek](/api-reference/cost-of-energy/conditions/day-of-week)            | `day_of_week`      | Only applies on the specified days of the week.      |
| [TimeOfDay](/api-reference/cost-of-energy/conditions/time-of-day)            | `time_of_day`      | Only applies within the specified time-of-day range. |
| [ExcludeHolidays](/api-reference/cost-of-energy/conditions/exclude-holidays) | `exclude_holidays` | Applies on all days except the specified holidays.   |
| [And](/api-reference/cost-of-energy/conditions/and)                          | `and`              | Applies when all sub-conditions are met.             |
| [Or](/api-reference/cost-of-energy/conditions/or)                            | `or`               | Applies when any sub-condition is met.               |
| [Not](/api-reference/cost-of-energy/conditions/not)                          | `not`              | Applies when the sub-condition doesn't apply.        |

### Value conditions

| Condition                                                   | Tag       | Description                                      |
| ----------------------------------------------------------- | --------- | ------------------------------------------------ |
| [Highest](/api-reference/cost-of-energy/conditions/highest) | `highest` | Keep the N highest values per resolution window. |
| [Lowest](/api-reference/cost-of-energy/conditions/lowest)   | `lowest`  | Keep the N lowest values per resolution window.  |
