The same facts can be stored two ways. Long data has one row per observation — customer, month, value. Wide data has one row per entity, with a column for each category — customer, then one column per month. The diagram above shows the reshape between them.
Note
Which Shape for Which Task
| Task | Preferred shape |
|---|---|
| Most modeling / tidy analysis | Long — one observation per row |
| Cross-tab reports and dashboards | Wide — categories as columns |
| Time-series per entity | Often wide — one column per period |
Pivoting long → wide spreads a category column into many columns; going wide → long collapses them back into key-value pairs.
Pivot vs Aggregate
A pivot often carries an aggregation: if several rows share the same entity and category, you must decide how to combine them — sum, mean, count. Choosing the wrong aggregation quietly changes what each cell means.
Watch out
The Reshape Traps
- Silent aggregation hiding duplicate keys you didn't know about
- Wide data with sparse categories creating lots of missing cells
- Losing a column you needed because it wasn't part of the pivot
Pivoting in the SKARI Data Editor
The Data Editor's pivot tool reshapes data without code: choose the row key, the column to spread, the value, and the aggregation — then preview the reshaped table before committing.
- Long-to-wide pivot with an explicit aggregation choice
- A preview of the reshaped table before you apply it
- The reshape recorded as a tracked pipeline step
Takeaway
Frequently Asked Questions
Long or wide for modeling?
Usually long ('tidy') data — one observation per row is what most modeling and plotting tools expect.
What's melt / unpivot?
The reverse of a pivot: it collapses wide columns back into long key-value rows.
Why did my pivot create blanks?
Because some entity-category combinations had no data — sparse categories leave empty cells in wide form.
Conclusion
Pivoting is just choosing the layout that fits the next step. Know when you need long vs wide, decide the aggregation deliberately, and preview the result — and reshaping becomes a tool, not a source of silent errors.
Takeaway
Joining Datasets
Combining tables after reshaping
Feature Engineering
Building features from wide layouts
Column Profiling
Checking the reshaped result