You have a couple options. When bringing in the account field at the data source level you could:
1) Concatenate account with function (so bring in both the account column with an underscore then the function column to the account field (function would go to function as normal at the data source level), something like 56789_COGSFunction and 56789_SGAFunction. Then in the account mapping you can do one for one or mask so that 56789_COGSFunction goes to 56789C and all else or specifically 56789_SGAFunction goes to 56789G.
2) Or you could bring account in to account and function in to function at the data source level and then in the account dimension, use a composite mapping that says something like:
A#?????:Ux#COGSFunction goes to A#?????C
A#?????:Ux#SGAFunction goes to A#?????G
Composite are when you need to leverage two fields (e.g. account and function) in the mapping of one field (e.g. account). But they are a slower mapping than a 1:1.
I woudl probably lean towards #1 since handling bringing in both fields at the data source level on import, may make for easier 1:1 mappings in transformation.
But either option should work.