Archive

Archive

Custom sorting axes

Hey folks,

 

I'm looking to create a chart using DAY OF WEEK. However, I can only sort the axis by descending or ascending. I want to display the bars in the order of the days of the week.

 

Two questions about this problem:

 

1) Does anyone know how to modify this?

 

2) What does Domo use as the default to order, if I don't specify any sorting? (i.e. in my case it started with Friday, then Saturday, then Sunday, etc.) I would think Domo would use the order in which the entries appear in the database, but that's not the case - in my case, first entry was Wednesday.

 

3) Assuming none of this funtionality exists... can we add it to the product backlog? Man Happy I think this would be useful.. not all metrics are presented alphabetical or numeric. Some examples that come to mind: city, day of week, different time periods that we assign names to, etc.

Welcome!

It looks like you're new here. Members get access to exclusive content, events, rewards, and more. Sign in or register to get started.
Sign In

Comments

  • There is this recommendation of creating a Beast Mode:

    https://dojo.domo.com/t5/Card-Building/Custom-Sorting-Using-a-Field-Specifically-Sales-Funnel/m-p/17907#U17907

     

    Does anyone know of a simpler way?

  • Hi all,

    Can anybody help out @phillipgornicki?

    Thanks!

  • Domo Employee

    @phillipgornicki,

    I wanted to make sure the answer we discussed was also posted here in case anyone else had a similar question.

    In order to sort by day of week you would have to create a beast mode filter that looks similar to this:


    CASE
    WHEN `column` = 'MONDAY' THEN 1
    WHEN `column` = 'TUESDAY' THEN 2
    WHEN `column` = 'WEDNESDAY' THEN 3
    WHEN `column` = 'THURSDAY' THEN 4
    WHEN `column` = 'FRIDAY' THEN 5
    WHEN `column` = 'SATURDAY' THEN 6
    WHEN `column` = 'SUNDAY' THEN 7
    END


    Also note that you may need to use the TRIM() function in case there are any extra white spaces. 

    Thank you.




    Domo Employee
    **Say "Thanks" by clicking the thumbs up in the post that helped you.
    **Please mark the post that solves your problem by clicking on "Accept as Solution"
  • When adding the custom sort to the "Sorting" field, it has no effect.  Attached is a screenshot and below is the code created in beast mode....what am I missing?

     

    DomoSort.PNG


    @TylerC wrote:

    @phillipgornicki,

    I wanted to make sure the answer we discussed was also posted here in case anyone else had a similar question.

    In order to sort by day of week you would have to create a beast mode filter that looks similar to this:


    CASE
    WHEN `column` = 'MONDAY' THEN 1
    WHEN `column` = 'TUESDAY' THEN 2
    WHEN `column` = 'WEDNESDAY' THEN 3
    WHEN `column` = 'THURSDAY' THEN 4
    WHEN `column` = 'FRIDAY' THEN 5
    WHEN `column` = 'SATURDAY' THEN 6
    WHEN `column` = 'SUNDAY' THEN 7
    END


    Also note that you may need to use the TRIM() function in case there are any extra white spaces. 

    Thank you.



    I have created a sort and applied as shown, however it seems to have no affect, am I missing something? Below is my code/validated in beast mode.

    (CASE
    When 'Month' ='January - 2016' THEN 1
    When 'Month' ='February - 2016' THEN 2
    When 'Month' ='March - 2016' THEN 3
    When 'Month' ='April - 2016' THEN 4
    When 'Month' ='May - 2016' THEN 5
    When 'Month' ='June - 2016' THEN 6
    When 'Month' ='July - 2016' THEN 7
    When 'Month' ='August - 2016' THEN 8
    When 'Month' ='September - 2016' THEN 9
    When 'Month' ='October - 2016' THEN 10
    When 'Month' ='November - 2016' THEN 11
    When 'Month' ='December - 2016' THEN 12
    When 'Month' ='January - 2017' THEN 13
    When 'Month' ='February - 2017' THEN 14
    When 'Month' ='March - 2017' THEN 15
    When 'Month' ='April - 2017' THEN 16
    When 'Month' ='May - 2017' THEN 17
    When 'Month' ='June - 2017' THEN 18
    When 'Month' ='July - 2017' THEN 19
    When 'Month' ='August - 2017' THEN 20
    When 'Month' ='September - 2017' THEN 21
    END)

  • HA, after posting the question, I could see the nuance with my text nearby to compare - solved it.  Needed to use ` and not ' for the column name.  Now sorting as expected.

This discussion has been closed.