When I try to add a formula to SYS07 it gives an error. check photo
I can see that your dimension in the module is "----Employee Hierarchy----" (see under Applies To). Probably you have added that by accident instead of 'E1 Departments'. Your formula refers to the Code of element from 'E1 Departments' dimension, but it is not a dimension in this module and therefore the error.
Change the "----Employee Hierarchy----" as a dimension to 'E1 Departments' and it will be fine!
I changed the Employee Hierarchy to E1 departments and it still gave me an error for some reason. When I look at pivot mode I have E1 department as one of the dimensions on pages. I don't know if that has anything to do with it.
you did it correctly! However, your dimension is called 'E1 Department' while in your formula you type 'E1 Departments' hence the error.