I have a scenario where I have `n ` departments and the number of dynamic column

I have a scenario where I have `n ` departments and the number of dynamic columns in table are created on the basis of the number of departments i.e. If there are 4 departments than four dynamic columns are displayed. Now I want to display data in these dynamically created columns according to the departments assigned to a user.
Please refer the screenshot

OriginalPostID-216635

OriginalPostID-216635

  Discussion posts and replies are publicly visible