Reshaping long data tables to wide data tables


Here, the user can perform long-to-wide transformations.

Example:

Let’s examine the following data. There are two plants and three machines per plant generating a power output. Thus, for each hourly timestamp, there are six entries.

Note that at Plant 1, the operator recorded the values in the order Machine1-Machine2-Machine3. However, the operator at Plant 2 used the opposite order.

The analyst wants to use the plant information as a key and roll out other columns.

The analyst is unsatisfied with the table format and decides not to reshape the machine column by unchecking it.

Notice that the ‘Machine’ column used the first value per rolled-out row. The analyst is not happy about that because the data is misleading now. For example, the transformed table indicates that at 8:00, generation was 100 and 130 kW for machine 1 at the respective plants. However, this is incorrect, as seen from the original data.

The analyst uses the machine column as a splitter to correct that mistake.

Please take a moment to notice the difference between this and the earlier resulting tables. In this case, the reshaping is performed per timestamp and machine ID.