Forum Discussion

LParker97's avatar
LParker97
Helper I
6 years ago
Solved

manually order matrix columns

Hi 

 

I have used the matrix tool to summarise my data but need to change the order of the column headers and was wondering how to go about doing this as I can currently only sort by totals or alphabetically. My matrix layout is belo

 

Days in Status Bucket ||| 0-2 | 6-7 | 8-14 | 3-5 | 15+|

-------------------------------------------------------
a                                  |||   -   |   -   |    -   |   -   |    -  |

b                                  |||   -   |   -   |    -   |   -   |    -  |

c                                  |||   -   |   -   |    -   |   -   |    -  |

d                                  |||   -   |   -   |    -   |   -   |    -  |

 

 

I want order these in terms of the ascending days in status buckets, any ideas?

  • You could do it either way.  I would use a SWITCH expression (instead of nested IFs) in your calculated column.  Something like

     

    SortOrder = SWITCH(Table[Column], "0-2",1,"6-7",2,"8-14",3,"3-5",4,"15+",5,6)

     

    where Table[Column] is replaced by the column used in your matrix columns

     

    If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat

     

4 Replies

      • mahoneypat's avatar
        mahoneypat
        Microsoft Employee

        You could do it either way.  I would use a SWITCH expression (instead of nested IFs) in your calculated column.  Something like

         

        SortOrder = SWITCH(Table[Column], "0-2",1,"6-7",2,"8-14",3,"3-5",4,"15+",5,6)

         

        where Table[Column] is replaced by the column used in your matrix columns

         

        If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

        Regards,

        Pat