Forum Discussion
Dynamically Generated Queries
- 2 years ago
In general you cannot have Power Query queries created on the fly, so I would say no. But I have no experience with Excel - maybe you can fudge something through Office scripts.
Hi lbendlin
Pulling data from a database, we have a ledger of clients where each is assigned to a staff member given some variables. Management will occasionally add/remove staff members assigned to these clients.
I have to build a workbook that has a worksheet for each staff member who currently has some clients assigned.
Currently I am referencing the main query with the complete list of clients and respective staff, then filitering staff asigned column to a given staff members name manually, rinse and repeat for ~20 staff members.
Is there a way for excel to automatically generate a new query when a new staff member is added to this list and hence automatically load a new worksheet with the table for that new staff member.
Haven't been too sure how to describe this process simply for google.
Unfortunately unable to make any changes to databse structure has to be all completed with Excel.
Regards
- lbendlin2 years agoSuper User
how is that new staff member assigned to clients?
- DanAspire422 years agoRegular Visitor
Comes from database, is just a column of staff names, with each row being a client and then their respective staff member in the column
- lbendlin2 years agoSuper User
In general you cannot have Power Query queries created on the fly, so I would say no. But I have no experience with Excel - maybe you can fudge something through Office scripts.