---
url: /process-functions/hierarchy-createorwipe.md
description: >-
  Creates a hierarchy in a dimension if it doesn't exist, or removes its
  structure if it does.
---

# hierarchy.createOrWipe

Creates a hierarchy in a dimension if it doesn't exist, or removes its structure if it does.

```js
hierarchy.createOrWipe(dimension, hierarchy)
```

## Parameters

| Parameter | Type | Description |
|---|---|---|
| `dimension` | `string` | The dimension's name or id. |
| `hierarchy` | `string` | The hierarchy's name. |

## Returns

An empty string when it succeeds, or an error message when the dimension can't be found.

## Examples

```js
hierarchy.createOrWipe("Account", "Profit and Loss");
```
