Reusable department preparation
Owner: Elmbrook Operations reporting coordinator.
Why: Reuse key cleanup across department extracts without copying the same expression by hand.
Data: Fictional staffing files with duplicates and inactive workers.
Done: A local macro-based flow and a Team, AvailableHours, Unit report.
Elmbrook Operations repeats the same roster preparation for several departments. The key cleanup should have a small, inspectable contract: receive a worker stream, trim the worker key and return the same fields with that key normalized. A macro can package that work without making its assumptions disappear.
Use the local macro wrapper in this project, then finish the department report outside it. The wrapper executes a nested workflow against the incoming table; it is a basic teaching model rather than a complete desktop macro authoring environment. Test the contract on different department records and keep source schema expectations explicit. The final report shows active available hours by team with a unit label, so another person can interpret the measure without opening the workflow.
input: {"source":"main"}
macro: {"workflow":{"name":"Worker key preparation","nodes":[{"id":"input","type":"input","x":70,"y":90,"config":{"source":"input"}},{"id":"tool1","type":"formula","x":230,"y":90,"config":{"field":"Worker","expression":"Trim([Worker])","type":"V_WString"}}],"edges":[{"from":"input","output":"O","to":"tool1","input":"I"}],"output":{"node":"tool1","anchor":"O"}}}
Worked example: The macro receives the current input stream. It must not depend on one hardcoded department file.