This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I now have a new problem where the Crosstab sorted all my columns into Name1, Name2, Name3, ... Name 36, State1, State 2... I would like to change the sort to Name1, State1, Name2, State2, etc. How would I go about this? Thanks in advance again!
Sadly there is no easy way of doing it. Here is how you can do it.
When columns are crosstabed it is arranged in ascending order of column names. Hence i am creating an column using record ID which will be the column name by that the actual columns would be sorted in the required manner.
1. Sorting based on GroupID and Name. So that we get Name1, State1, Name 2, State 2...
2. I am using recordID and setting position. Since ID(pre-existing column) is not there in the name rows i am adding it using union tool.
3. Crosstabing it with name as recordID and value as new name. This way column name is 1,2,3.. (position holder) under that actual column names as 1st row data.
4. Using dynamic rename tool i am changing column name by taking names from 1st row. Now we have columns with position maintained.
5. While union tool the output data always maintains column order of the first connection. Hence column names order is first connection and data is second. This way you will get columns in desired order.