This function melts or unpivot your data. In many cases, data for each identity is presented in rows which is not suitable for consuming in the model or visualization. MELT makes this process easy for you by restructuring your data in columns.
AXCEL.MELT(data, id_columns, value_columns)
The AXCEL.MELT function syntax has the following arguments:
Data Required. This is the input which needs to be unpivot.
id_columns Required. This variable lists the name of columns to be used for unpivoting. It could be a single column name or a vector of multiple columns.
value_columns Required. This is a list of columns to be extracted from the table and assign to each group.
As an example, the ERP system in a company reports its monthly sales for products A, B and C in this table:
As you can see, this data is not suitable to be used for modeling as a cross-section or a panel data. As a result, this data needs to be transferred to a columnar structure. To do so, we can simply run the MELT function as follows (consider data is located at A1:G4):
In fact, A1:G4 is the location of data, A1 defines the identification of each product which is located at A1 (product) and monthly data are in columns B to G which have the headers at B1 to G1. After running the function, you get this result:
As you can see, data is restructured in three columns. Each row presents the sales for each product A, B or C in Months January to June in 2020. The data is ready to be used for other functions or visualization.
See other data management function.