Hello @Rykie, a couple of questions - is the table always going to have only one row of data? Are the numbers in the column headers going to be there, or is that just a sample?
The above data refers to the Organisation structure. There are no numbers in it, but I can rename it to Org Level1, Org Level2 etc.
Every Row with have a person (and other data) and then the organisation structure next to it.
The organisational levels needs to shift to the left if it is empty.
Need to remove all the empty cells and shift everything left.
I can do this with multiple if statements.
I just wanted to know if there is a better way of doing this
The Org1 will never be empty
Here is how I would do it - I would unpivot the table, transform the data and then pivot the table again to obtain the desired output.
Here is sample project and the table to transform in Excel. Download both files (storing them in the same folder), and then open the .morph to see the transformations.
For this solution to work it’s important for the Column names to have the number at the end. This also orders the columns correctly after the final pivot.
@Jochen_Marquardt I love that we can approach the same issue from different sides. Thank you for your contribution. I always say there is more than on way to get to the end result. We need to figure out what works best in your current environment.