I have a report output formatted something like this:
As you can see, it's dumping the column header into one column, and the value in the next. This wouldn't be too problematic, but not every item in the list has the same data entries present, so sometimes the second column is the site type, sometimes it's computer name. Sometimes the fourth is computer name, sometimes it's first name.
I know how to do this formulaically - make a column with the name I want, then do an Xlookup across this row for the column name, and pull the results from a matching array displaced one cell to the right. But I'm not sure how to do this in PowerQuery's scripting language, and I can't see a pre-built way to make this behavior work by using menu selections.
If anybody has some advice, I'd appreciate the help. I can reformat this all formulaically, but the dataset is thousands of lines, and I suspect this will make it much slowed to work with than using a query.
Global User Defined Field Label 01 | Global User Field 01 | Global User Defined Field Label 02 | Global User Field 02 | Global User Defined Field Label 03 | Global User Field 03 | Global User Defined Field Label 04 | Global User Field 04 | Global User Defined Field Label 05 |
SITE TYPE | USER LAST NAME | Boberson | USER FIRST NAME | Bob | USER MIDDLE INITIAL | B | USER STATUS | |
SITE TYPE | COMPUTER NAME | Dell-XYZ | USER LAST NAME | Boberson | USER FIRST NAME | Bob | USER MIDDLE INITIAL |
As you can see, it's dumping the column header into one column, and the value in the next. This wouldn't be too problematic, but not every item in the list has the same data entries present, so sometimes the second column is the site type, sometimes it's computer name. Sometimes the fourth is computer name, sometimes it's first name.
I know how to do this formulaically - make a column with the name I want, then do an Xlookup across this row for the column name, and pull the results from a matching array displaced one cell to the right. But I'm not sure how to do this in PowerQuery's scripting language, and I can't see a pre-built way to make this behavior work by using menu selections.
If anybody has some advice, I'd appreciate the help. I can reformat this all formulaically, but the dataset is thousands of lines, and I suspect this will make it much slowed to work with than using a query.
Last edited: