Table optimizer
Turn long records into individual data points
Sign up
Use this script to turn a "wide" table - one with individual records each with multiple different associated fields - into a "narrow" one - with a record for each associated field and field value.
For example, if your original table looked like:
| Product | Jan Sales | Feb Sales | Mar Sales |
-------------------------------------------------------------
| A | 32 | 168 | 180 |
| B | 24 | 150 | 175 |
| C | 64 | 144 | 165 |
You could use this script to automatically create a new "narrow" table, that would look like the following:
| Product | Month Sales | Sales |
-------------------------------------------------
| A | Jan Sales | 32 |
| A | Feb Sales | 168 |
| A | Mar Sales | 180 |
| B | Jan Sales | 24 |
| B | Feb Sales | 150 |
| B | Mar Sales | 175 |
| C | Jan Sales | 64 |
| C | Feb Sales | 144 |
| C | Mar Sales | 165 |
This can then help make certain calculations and rollups more efficient.
View source