Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Greetings! all
I want to transpose the following data by converting column names to rows.
Name Date Grocery Utility miscellaneous
Thierry 12/1/2023 100 150 50
Jordan 6/5/2023 50 50 50
Resultant table
Name | Date | Expenses | Amount |
Thierry | 12/1/2023 | Grocery | 100 |
Thierry | 12/1/2023 | Utility | 150 |
Thierry | 12/1/2023 | miscellaneous | 50 |
Jordan | 6/5/2023 | Grocery | 50 |
Jordan | 6/5/2023 | Utility | 50 |
Jordan | 6/5/2023 | miscellaneous | 50 |
Thanks a lot.
Use cross load for this caSe
OriginalTable:
LOAD * INLINE [
Name, Date, Grocery, Utility, miscellaneous
Thierry, 12/1/2023, 100, 150, 50
Jordan, 6/5/2023, 50, 50, 50
];
TransposedTable:
CrossTable (Expense, Amount)
LOAD
Name,
Date,
Grocery,
Utility,
miscellaneous
FROM
OriginalTable;
DROPT ABLE OriginalTable;
@Chanty4u thanks for the response. Is there a way to filter out the highlighted within the cross table?
Remove date from your cross table script
CrossTable (Expense, Amount)
LOAD
Name,
Grocery,
Utility,
miscellaneous
FROM
OriginalTable;
DROPT ABLE OriginalTable;