Label rows, edit cells and fill blanks
The Label & Edit group in Describe your transformation > Filter, Label & Replace has three tasks. Label & Insert Values writes a value into all rows or only rows that match a condition. Edit Cells lets you type corrections straight into the grid (Edit single cells in the grid). Fill Missing Values fills empty cells from nearby rows or predicted values.
Label rows that meet a condition
Label & Insert Values inserts a value into every row, or only into rows that match a condition.
- Open Label & Insert Values.
- In Enter a value, type the value. The input adapts to the type of the column you write into. To insert a parameter's value, click the Val chip and choose Parameter; only parameters of the column's type are listed.
- Choose All cells or Some cells.
- For Some cells, click Add Condition. In the condition dialog, describe the condition in natural language or build it with column and operator dropdowns. A Condition added chip then shows the condition, with edit and delete icons.
- In Place in new column, keep New and type a column name and type, or click the word new and choose Existing to pick a column.
- Click Apply.
Insert different values for different rows
Click Add another value to insert a different value into other rows in the same task. Each earlier value needs a condition (Some cells); the last value then applies to All remaining cells. Drag values to reorder them.
For example, to tag orders by size, insert Large into Some cells where order_amount is greater than 1000, then Add another value Standard for All remaining cells, placed in a new column order_size.
Stamp rows with the current date or time
When the result column is a Date column, the value is a dropdown with three options:
| Option | What it inserts |
|---|---|
| Datetime | A fixed date and time you pick in the Choose date time picker, to the second. It never changes. |
| Current Date UTC | The UTC date the step runs, at midnight (00:00:00). |
| Current Time UTC | The UTC date and time the step runs. |
Current Date UTC and Current Time UTC are worked out again on every run, including scheduled runs and reruns, and every row gets the same value in a given run. Use them to stamp a load date or a "last refreshed" time.
Label values from an Explore card
In an Explore card, click the three-dot menu on a value bar and choose Replace all values like this: Label & Insert Values opens with that value as the condition (Explore cards). A column's 3-dot menu also opens Label & Insert Values with that column pre-selected.
Fill empty cells from the rows around them
Fill Missing Values fills empty cells in a column.
- In Select column, choose the column with empty cells.
- Choose a Fill Method:
- Directional copies the closest value above or below in the column.
- Smart predicts each empty cell from patterns in your complete rows.
- For Directional, choose a Direction: Above fills each empty cell with the nearest non-empty value above it; Below uses the nearest one below.
- Optional, Directional only: Add Sort sets the row order first, which decides what counts as above or below.
- Optional, Directional only: Group by fills only within groups, so a value never spills from one group into another.
- Check the Preview panel, then click Apply.
With AI fill, the step takes time to run, so its preview waits for you: "This function takes time to run. Click Run preview to see its result." Click Run preview.
For example, a report export lists region only on the first row of each block. Choose Directional, Above, to copy each region down to the empty rows below it.
Troubleshooting fills
| Symptom | Cause | Fix |
|---|---|---|
| Fill copied values across groups | No Group by set | Add Group by so filling stays within each group |
| Fill used the wrong neighbour | Row order isn't what you expect | Use Add Sort to set the order |
Related
- Edit single cells in the grid: one-off corrections and the cell editing setting.
- Filter rows: the operators you can use in a condition.
- Find and replace values: replace values by rule rather than cell by cell.
- Parameters and snippets: insert a value you change in one place.
Something wrong? support@mammoth.io