Forum Discussion
Add data column from source database after query is initially created?
- 8 years ago
I went into Advanced Editor after opening "edit queries".
1) Bolded is what I inserted into the top line:
let
Source = Sql.Database("dbserver", "db", [Query="SELECT #(lf) [SRV_RQST_B_NUMBER_DESC]#(lf),[SRV_RQST_B_STATE_DESC]#(lf),Then i inserted the below line into the columns where they're listed. Apparently #1 and #2 are required.
2)
SRV_RQST_B_STATE_DESC = Table.AddColumn(SRV_RQST_B_STATE_DESC),
Then i clicked OK and it showed up in the table under the query.
Any chance you can post the query from Advanced Editor in Query Editor? You should be able to open Query Editor, refresh the preview and go from there, making certain that your query does not remove other columns, for example. I'd have to see the query to know where things might be going wrong. Sometimes, with CSV files for example, you have to edit the source row to specify increasing the column count.
Based on your feedback, I was able to get the right logic in my Advanced Editor. With that, thank you for your solution.
- v-yulgu-msft8 years agoMicrosoft Employee
Hi MattAdams,
Glad to hear that you have resolved it. How did you add another column from source database finally? Would you please share the final Power Query to show us the solution? That case, more users may benefit from here.
Thanks,
Yuliana Gu
- MattAdams8 years agoHelper I
I went into Advanced Editor after opening "edit queries".
1) Bolded is what I inserted into the top line:
let
Source = Sql.Database("dbserver", "db", [Query="SELECT #(lf) [SRV_RQST_B_NUMBER_DESC]#(lf),[SRV_RQST_B_STATE_DESC]#(lf),Then i inserted the below line into the columns where they're listed. Apparently #1 and #2 are required.
2)
SRV_RQST_B_STATE_DESC = Table.AddColumn(SRV_RQST_B_STATE_DESC),
Then i clicked OK and it showed up in the table under the query.
- MattAdams8 years agoHelper I
i'll share my info soon!