Skip to content

Conversation

elijahpetty
Copy link
Contributor

@elijahpetty elijahpetty self-assigned this Oct 2, 2025
@elijahpetty elijahpetty added the NoReleaseNotesNeeded No release notes are needed. label Oct 2, 2025
Copy link
Contributor

github-actions bot commented Oct 2, 2025

Deploying docs previews for a5ca0d8 (available for 14 days)

Python
Groovy

Copy link
Contributor

@jjbrosnan jjbrosnan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start, just needs some polishing.

title: Keyed transpose
---

This guide shows you how to use `keyedTranspose` to transform data from a long format to a wide format by pivoting column values into new column names. This is useful when you need to reshape data for analysis, reporting, or visualization.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link to keyedTranspose reference doc.


This guide shows you how to use `keyedTranspose` to transform data from a long format to a wide format by pivoting column values into new column names. This is useful when you need to reshape data for analysis, reporting, or visualization.

## When to use keyedTranspose
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we should refer to it as a keyed transpose in headings and whatnot.


## When to use keyedTranspose

Use `keyedTranspose` when you need to:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ref link

- Each unique `Level` value (INFO, WARN, ERROR) becomes a column.
- The `Count` aggregation counts occurrences for each Date-Level combination.

## Working with multiple row keys
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Working with multiple row keys
## Multiple row keys


Each unique combination of `Date` and `Server` creates a separate row in the output.

## Using multiple aggregations
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Using multiple aggregations
## Multiple aggregations

Comment on lines +134 to +136
| Single aggregation, single column-by | Value from column-by column | `INFO`, `WARN` |
| Multiple aggregations | Aggregation name + value | `Count_INFO`, `Sum_WARN` |
| Multiple column-by columns | Values joined with underscore | `INFO_10`, `WARN_20` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without examples to illustrate these, I don't know what this means.

| Starts with number | Prefixed with `column_` | `123` → `column_123` |
| Duplicate names | Suffix added | `INFO`, `INFO2` |

### Best practice: Sanitize data before transposing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I'd say this is a best practice. In cases of larger tables, mass string replace operations could be expensive.

A better way to go about this would be to show an example of everything in the table above. Each example can go into its own subsection. Either that, or you can present every item in the table above as a subsection with an example.


## Common patterns

### Pattern 1: Sales by region and product
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels more like a simple example than a common pattern.

)
```

### Pattern 2: Time-series metrics
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO presenting these as examples rather than "common patterns" would be beneficial. I don't see how these are common patterns, but they're obviously useful examples for learning.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments on Python that I made on Groovy (if they apply).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants