Data orientation is Horizontal


I have the data extracted from SAP APO using listcube function and all the data are presented horizontally.


  1. There are multiple characteristics before a series like the product code, sub-brand, location, store etc. can i forecast without removing these characters?
  2. Data downloaded contains more than 3000 rows and 72 columns in which 60 are 5 years of data on a monthly level. As the data are present horizontally, how can i run a forecasting model in R without changing the orientation?

Yes, you can

Reshaping your data to a long format would make things much easier by far, and have in mind that this is not going to affect your raw data and you can easily get back to a wide format after the forecasting is done.

If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.

1 Like

Thank you! Would be great if you can provide the code or what package to use to reshape the data. Also how to define the a time series starts from a particular column or row?

You could use gather() or pivot_longer() from tidyr package for that purpose

Sorry I don't understand your question, as I said before, if you need specific help, please provide a reprex as explained in the link I gave you.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.