Custom Sorting

Hi Everyone,

I followed the steps outlined here: but cannot get my custom sorting to work. 


Chart: Heatmap

Data: Google Ads Data, broken out by date and hour.


I attempted to do custom sorting for Day of Week (using a date transform) and Dayparts (custom grouing based off hours of day)


Dayparts - The hours in the data is represented 0 - 23 (Military time). Since I'm using a heatmap, it would look unwieldy to have that many rows of data. this is the beast mode I used to group:



When `Hour Of Day` in ('6', '7', '8', '9') then 'Morning 6-9AM'
When `Hour Of Day` in ('10', '11', '12', '13', '14', '15', '16') then 'Daytime 10-4PM'
When `Hour Of Day` in ('17', '18', '19') then 'Early Fringe 5-7PM'
When `Hour Of Day` in ('20', '21', '22') then 'Prime 8-10PM'
When `Hour Of Day` in ('23', '0') then 'Late Fringe 11-12AM'
When `Hour Of Day` in ('1', '2', '3', '4', '5') then 'Overnight 1-5AM'




to do a custom sort, I used this beast mode:



when 'Dayparts' = 'Overnight 1-5AM' then 1
when 'Dayparts' = 'Morning 6-9AM' then 2
when 'Dayparts' = 'Daytime 10-4PM' then 3
when 'Dayparts' = 'Early Fringe 5-7PM' then 4
when 'Dayparts' = 'Prime 8-10PM' then 5
when 'Dayparts' = 'Late Fringe 11-12AM' then 6



I then take this beast mode for the sort and drag it into the sorting field. I make sure there is no aggregation and do ascending order. The result is that it's out of order (See my attached screenshot). 


Now onto Day of The Week


Day of Week. This is the beast Mode I used to return a day of week name:


when dayofweek(`Date`) = 1 then 'Sunday'
when dayofweek(`Date`) = 2 then 'Monday'
when dayofweek(`Date`) = 3 then 'Tuesday'
when dayofweek(`Date`) = 4 then 'Wednesday'
when dayofweek(`Date`) = 5 then 'Thursday'
when dayofweek(`Date`) = 6 then 'Friday'
when dayofweek(`Date`) = 7 then 'Saturday'


this is the beast mode I used to do the custom sort



When 'Day of Week Name' = 'Monday' then 1
When 'Day of Week Name' = 'Tuesday' then 2
When 'Day of Week Name' = 'Wednesday' then 3
When 'Day of Week Name' = 'Thursday' then 4
When 'Day of Week Name' = 'Friday' then 5
When 'Day of Week Name' = 'Saturday' then 6
When 'Day of Week Name' = 'Sunday' then 7



Similar to the Dayparts sort beast mode, everything is returned out of order. 


What am I doing wrong? The video I linked makes sense...maybe it's the fact that I am doing another step before the custom order that's throwing it off? Thanks!



Best Answer

  • user32470
    Answer ✓

    Hi Grant


    I ended up being able to sort it - I took the original day part data the beast mode group was created from (hour of the day) and dragged that into the sorting file as ascending. to answer your question, yes the beast mode does return numerical values when I put in secondary dimension (eg: cost)


    thanks though!!


  • Update - I was able to correct the Day of Week to make it sort in order. 


    I made a new beast mode called "Day of Week Transform" where it just contained


    DAYOFWEEK ('Date')


    Then I dragged that beast mode into the sort and I was able to sort Day of The Week correctly.


    The dayparts (hours), I'm still stumped on...

  • Hi @user32470 

    For your custom sort for the day parts - is your beast mode actually returning different numerical values or are they all the same?

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**