Forum Discussion
Adding a blank column & retaining data
Hi
I have a attendance excel document which I'm getting data from a third party source but I want to add a notes column so they can add notes against a student.
problem is I cant do this in the third party so I though I'd add a blank column in power query but after a refresh. It blanks that column in the sheet. Is it possible to exclude the column from over writing that data stored on the sheet
5 Replies
- PhilipTreacySuper User
Hi Ful56
Nope sorry you won't be able to do that. If you add a blank column in PQ and load that to your Excel sheet, then type data into that column - every time you refresh the query, that column will be overwritten with the blanks from the query/table inside PQ.
Regards
Phil
- Ful56Regular Visitor
Thanks PhilipTreacy is there away of keeping a column sync on the sheet out side of PQ so if a new student is added it moves the notes column notes down so they stay with the student?
- AlienSxSuper User
- AdamboerResponsive Resident
Yes, it is possible to exclude the column from overwriting the data stored in the sheet. You can do this by creating a new query that combines the attendance data with the notes data and then outputting the combined data to a new sheet in the same Excel workbook.
Here's an example of how you can do this:
Open the Excel workbook with the attendance data and open Power Query.
Load the attendance data into Power Query.
Create a new query that reads the notes data from another source, such as a separate Excel workbook or a database.
Merge the attendance data query and the notes data query using a common column such as the student ID.
In the merge options, select the option to keep only the columns from the attendance data query.
Add a new column to the merged data that contains the notes for each student.
Load the merged data into a new sheet in the same Excel workbook, but exclude the column with the attendance data that you want to keep.
Save the Power Query changes and refresh the data when needed.
By following these steps, you can add a notes column to your attendance data without overwriting any of the data in the original sheet.
- Ful56Regular Visitor
Thank you for the guidance, we dont have the notes yet as the idea is the staff will use the attendance data and make comments againest a week or a term column that contains attendance data. as the notes column isnt coming from PQ and is within the excel sheet next the attandance data column, when a new student joins the attendance columns all shift down which is great as its in sync as its coming from pq but the attendance notes do not.