> For the complete documentation index, see [llms.txt](https://docs.redivis.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.redivis.com/reference/workflows/transforms/variable-creation-methods/other.md).

# Other

### Cast

Converts the type of a variable. Consider using the "retype" step for additional functionality. –> [learn more](https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#cast)

```sql
CASE WHEN @expression IS NULL THEN NULL ELSE COALESCE(SAFE_CAST(@expression AS @castType), ERROR(FORMAT('Could not cast @expression to @castType, encountered value: %t', @expression))) END
```

#### Return type

dynamic (input-dependent)

#### Parameters

| Name        | Type                                                                                                                       | Allowed values                                                                           | Required | Placeholder (in UI) |
| ----------- | -------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -------- | ------------------- |
| `@variable` | [variable](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#variable) | any [Redivis type](https://docs.redivis.com/reference/datasets/variables#variable-types) | true     | -                   |
| `@castType` | [enum](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#enum)         | any of: `INT64`, `FLOAT64`, `STRING`, `TIME`, `DATETIME`, `DATE`, `BOOLEAN`              | true     | *(Choose a type)*   |
| `@safe`     | [boolean](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#boolean)   | any [boolean](https://docs.redivis.com/reference/datasets/variables#boolean)             | true     | -                   |

### Coalesce

Takes the first non-null value of a set of values. –> [learn more](https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#coalesce)

```sql
COALESCE(@expression)
```

#### Return type

dynamic (input-dependent)

#### Parameters

| Name          | Type                                                                                                                                                                                                                                                     | Allowed values                                                                           | Required | Placeholder (in UI) |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -------- | ------------------- |
| `@expression` | [variable](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#variable)s or [literal](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#literal)s | any [Redivis type](https://docs.redivis.com/reference/datasets/variables#variable-types) | true     | -                   |

### Constant

Create a constant value as a variable –> [learn more](https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#constant)

```sql
undefined
```

#### Return type

dynamic (input-dependent)

#### Parameters

| Name       | Type                                                                                                                                                                                                                                                   | Allowed values                                                                           | Required | Placeholder (in UI) |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------- | -------- | ------------------- |
| `@literal` | [variable](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#variable) or [literal](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#literal) | any [Redivis type](https://docs.redivis.com/reference/datasets/variables#variable-types) | true     | -                   |

### Hash

Returns an MD5 hash of all values as a base64 encoded string. Non-string values will be first coerced to strings. Note that order of inputs will affect the hash. –> [learn more](https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#md5)

```sql
TO_BASE64(MD5(CONCAT(@expression)))
```

#### Return type

string

#### Parameters

| Name          | Type                                                                                                                                                                                                                                                     | Allowed values                                                                           | Required | Placeholder (in UI) |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -------- | ------------------- |
| `@expression` | [variable](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#variable)s or [literal](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#literal)s | any [Redivis type](https://docs.redivis.com/reference/datasets/variables#variable-types) | true     | -                   |

### Sample

Create a random, deterministic value in the range of \[0, 1) based on a specific set of variable(s). –> [learn more](https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#sample)

```sql
(FARM_FINGERPRINT(CONCAT(@variable)) + POW(2, 63)) / POW(2, 64)
```

#### Return type

float

#### Parameters

| Name        | Type                                                                                                                        | Allowed values                                                                           | Required | Placeholder (in UI) |
| ----------- | --------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -------- | ------------------- |
| `@variable` | [variable](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#variable)s | any [Redivis type](https://docs.redivis.com/reference/datasets/variables#variable-types) | true     | -                   |

### UUID

Generate a random universally unique identifier (UUID) –> [learn more](https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#uuid)

```sql
GENERATE_UUID()
```

#### Return type

string

#### Parameters


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.redivis.com/reference/workflows/transforms/variable-creation-methods/other.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
