Pivot Columns
Pivoting transforms unique values into separate columns.
Example:
|
Month |
Sales |
|
Jan |
50000 |
|
Feb |
60000 |
Can be transformed into:
|
Jan |
Feb |
|
50000 |
60000 |
Unpivot Columns
Unpivot converts columns into rows.
Example:
|
Product |
Jan |
Feb |
Mar |
|
Laptop |
50000 |
60000 |
70000 |
After Unpivot:
|
Product |
Month |
Sales |
|
Laptop |
Jan |
50000 |
|
Laptop |
Feb |
60000 |
|
Laptop |
Mar |
70000 |
Custom Columns
Create a new column using a formula.
Example:
Profit = Sales – Cost
Conditional Columns
Create values based on conditions.
Example:
If Sales >= 50000 → “High”
Else → “Normal”
Practice
Create:
- Profit column
- Sales Category column
- High/Normal sales classification