Forum Discussion

LillyLegenda's avatar
LillyLegenda
Icon for Helper III rankHelper III
5 years ago
Solved

Matrix: Sorting by columns

Hi, I may have a simple question, but I just cannot get it to work.

 

I have a Matrix and I would like the user to be able to click on BB, DD or Inv to sort by the column.

How is this possible? 

Thank you 🙂

 

 

 

  • Anonymous's avatar
    Anonymous
    5 years ago

    LillyLegenda 

     I think you cannot sort by column.

     
    Instead you can create New Column like below:


    BB = IF(Sheet1[OrderType] = "BB",Sheet1[Volume],0)
    DD = IF(Sheet1[OrderType] = "DD",Sheet1[Volume],0)
    INV = IF(Sheet1[OrderType] = "INV",Sheet1[Volume],0)


    Once done add these Columns to the "Values" and removed Order Type from "Columns". This will enable the sorting option as per your requirement.


    Please find screenshots below:

     

    Thanks,

    Sandeep

8 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    LillyLegenda 

     I think you cannot sort by column.

     
    Instead you can create New Column like below:


    BB = IF(Sheet1[OrderType] = "BB",Sheet1[Volume],0)
    DD = IF(Sheet1[OrderType] = "DD",Sheet1[Volume],0)
    INV = IF(Sheet1[OrderType] = "INV",Sheet1[Volume],0)


    Once done add these Columns to the "Values" and removed Order Type from "Columns". This will enable the sorting option as per your requirement.


    Please find screenshots below:

     

    Thanks,

    Sandeep

      • amitchandak's avatar
        amitchandak
        Icon for Super User rankSuper User

        LillyLegenda , there is no option for column(pivot) to sort -here it is OrderType . It will sort Ascending or based on sort column

         

        Say I want sort descending

        new columns

        Order Type 1 = [Order Type]

        Order TypeSort =rankx(all(Table), [Order Type] )

         

        Mark Order TypeSort  as sort column for Order Type 1 and use that in sorting

        I disucssed this type of case in video - https://www.youtube.com/watch?v=KK1zu4MBb-c

  • LillyLegenda , 

     

    Choose sort by column and order by Asc or Desc from 3 dot menu on the visula (...)

     

    Regards, 

    Manikumar