Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/functions/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,17 @@ export function logMessage(message: string): string {
* @param values The range of cells that represent your range of values.
* @returns The normalized range of cells.
*/
export function unpivot(headers: string[], rows: string[], values: string[][]): String[][] {

export function unpivot(headers: any[], rows: any[], values: any[][]): any[][] {
let unpivot_data = [];

for (var row = 1; row <= rows.length; row++) {
for (var header; header <= headers.length; header++) {
for (var row = 0; row < rows.length; row++) {
for (var header = 0; header < headers.length; header++) {
unpivot_data.push([rows[row], headers[header], values[row][header]]);
}
}

return unpivot_data

return unpivot_data;
}
// 'Put all the pieces together.
// UnpivotData(row_num, 1) = RowField
Expand Down Expand Up @@ -192,4 +191,4 @@ export function unpivot(headers: string[], rows: string[], values: string[][]):

// headers
// rows
// values
// values