Yes, you can transpose this summary table so that the Stage values become the column headers and each ECL type becomes a row, like this:
| Metric | Stage 1 | Stage 2 | Stage 3 | Stage 4 |
|---|
| ECL_YE | ... | ... | ... | ... |
| ECL_NoOverlays | ... | ... | ... | ... |
| ... | ... | ... | ... | ... |
✅ Here's how you can do this in SAS using PROC TRANSPOSE:
/* Step 1: Transpose the dataset so that Stage values become columns */
proc transpose data=Final_Consolidated_Summary out=Transposed_Summary(drop=_NAME_) prefix=Stage_;
by Stage;
run;
But this method flips the wrong axis — we want ECL metrics as rows and Stages as columns, not the other way around.
✅ Correct approach: Use PROC TRANSPOSE with the metric names as rows, and Stage numbers as columns
To do that, we need to reshape the data ourselves:
- Convert each row in your current wide-format table into multiple rows — one for each metric.
- Transpose so that stages become columns.
Let’s go through this step-by-step:
Step 1: Reshape to Long Format
data long_summary;
set Final_Consolidated_Summary;
length Metric $32 Value 8;
Metric = "ECL_YE"; Value = ECL_YE; output;
Metric = "ECL_NoOverlays"; Value = ECL_NoOverlays; output;
Metric = "ECL_tmin1_Redeemed"; Value = ECL_tmin1_Redeemed; output;
Metric = "ECL_Staging"; Value = ECL_Staging; output;
Metric = "ECL_Macro"; Value = ECL_Macro; output;
Metric = "ECL_Macro_by_tmin1"; Value = ECL_Macro_by_tmin1; output;
Metric = "ECL_t0_Originated"; Value = ECL_t0_Originated; output;
Metric = "ECL_ModelUpdate"; Value = ECL_ModelUpdate; output;
Metric = "ECL_t0"; Value = ECL_t0; output;
Metric = "ECL_t0_by_tmin1"; Value = ECL_t0_by_tmin1; output;
keep Stage Metric Value;
run;
Step 2: Transpose — Make Stage values into columns
proc transpose data=long_summary out=summary_transposed(drop=_NAME_) prefix=Stage_;
id Stage;
by Metric;
var Value;
run;
Now you’ll get:
| Metric | Stage_1 | Stage_2 | Stage_3 | Stage_4 |
|---|
| ECL_YE | 2976785.54 | 2099924.14 | ... | ... |
| ECL_NoOverlays | 2375801.71 | 600034.91 | ... | ... |
| ... | ... | ... | ... | ... |
Optional: Clean Up for Reporting
You can rename the columns, format the numbers, or export this to Excel using PROC EXPORT or ODS EXCEL.
Final Notes
- Transposed table is easier for report generation (e.g., sending to Excel/Power BI).
- This format supports comparisons of ECL metrics across Stages cleanly.
Let me know if you'd like to export this result or also include a Grand Total column/row!