I have a heatmap based on a dataset where the Y axis is days of the week. The dataset identifies the day of the week using a weekday_id field (1=Mon,7=Sun) and the text of the day is in a field called Day in a joined table. I want to use the text labels for the Y axis e.g. Fri Wed but have them sorted in the order of weekday_id i.e. starting with Mon and ending with Sun. I can’t see an obvious way to do this?
Hi @ryendall
looks like the “different sort option” is not available for a heatmap. What if concat the id and string e.g. “1 - Mon”?
BR
Could do, but that’s an ugly hack. My customers don’t want or need to see numbers next to the day of the week
Hi @ryendall,
You may be able to get away with something like I did below. I prefix the day of week with the correct number of spaces so that the day will collate correctly. Depending on your start of week you’d add spaces accordingly. Looks like the spaces get stripped. Sunday had 4 in front. Mon-Wed had 3, Thursday 2 and Friday 1.
ifelse(
({Day_Number} = 1), ’ Sunday’,
({Day_Number} = 2), ’ Monday’,
({Day_Number} = 3), ’ Tuesday’,
({Day_Number} = 4), ’ Wednesday’,
({Day_Number} = 5), ’ Thursday’,
({Day_Number} = 6), ’ Friday’,
‘Saturday’ // Default value for other cases
)
Hi @ryendall,
Did @Bill_L’s suggestion help you? His suggestion should work as a workaround, and we will also note this down as a feature request.
Thank you,
Asem
Yes it does. Thanks @Bill_L !
When using this approach before, I have found that I needed to use a hard space rather than a soft space