Forum

Add column from raw...
 
Notifications
Clear all

Add column from raw data after query built?

3 Posts
3 Users
0 Reactions
171 Views
(@kendrickg)
Posts: 11
Active Member
Topic starter
 

This may be a simple thing but I'm having difficulty figuring it out.  I need to add a column to my workbook query from the raw data.  I have the query built the way I want it but need to add another field from the raw data that I didn't initially have.  Is there an easy way to do this this?  I've spent quite a bit of time building this and don't want to mess it up.

Thanks,

Gary

 
Posted : 14/11/2019 3:47 pm
(@mynda)
Posts: 4761
Member Admin
 

Hi Gary,

If the column is in the raw data then I'm assuming you've deleted it along the way after import, or you didn't expand that particular column in the 'Expanded Table Column step? If so, you can just edit that step and change the filter state so that the column is now included.

Mynda

 
Posted : 14/11/2019 7:24 pm
(@catalinb)
Posts: 1937
Member Admin
 

Hi Gary,

You can use a dynamic way to expand the table, this way any new column added in source will automatically show up, without manual editing.

You have to replace the Expand Table Column1 arguments where column names are hard typed with a function that extracts the column names from the previous step:

The expand column formula usually looks like:

= Table.ExpandTableColumn(#"Merged Queries", "Column1", {"Column1", "Column2"}, {"Column1", "Column2"}) (there are 2 lists, with initial column names and the new names, most of the times they are identical)

Replace the column names lists:

= Table.ExpandTableColumn(#"Merged Queries", "Column1", Table.ColumnNames(Table.Combine(#"Removed Other Columns1"[Column1])), Table.ColumnNames(Table.Combine(#"Removed Other Columns1"[Column1])))

 
Posted : 15/11/2019 12:17 am
Share: