operation with many numeric columns without unpivoting
Hi everyone,
I have a dataset with multiple monthly revenue columns (e.g., Jan-2023, Feb-2023, …,Dec-2040) . I need to check whether the revenue for each month is higher, lower, or the same compared to the prior month (e.g., Jan-2023 vs. Feb-2023, etc).
Since my dataset is already long format and has many columns, I would like to use a loop (a Column List Loop?). However, I’m not sure how to access the previous iteration’s column (i.e., the column from the prior month) within the loop.
Does anyone have an idea on how I can accomplish this without unpivoting the data?
Thanks in advance!