Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Arvind_Singh
Contributor II
Contributor II

sort date range in bar chart dimension

Hi all,

I have below dimension in the Qlik Sense bar chart -

 

= DATE(weekstart (DATE(floor([date_id]), 'DD-MM-YYYY')),'DD-MMM-YYYY') & ' to '& DATE(Weekend(DATE(floor([date_id]), 'DD-MM-YYYY')),'DD-MMM-YYYY')  

  • the format of [date_id] is MM/DD/YYYY.
  • the measure is count([incident_num])

Could you please advice how can the date range in X axis be sorted?

1 Solution

Accepted Solutions
Or
MVP
MVP

Several options, but the easiest one would be to use Dual(DATE(weekstart (DATE(floor([date_id]), 'DD-MM-YYYY')),'DD-MMM-YYYY') & ' to '& DATE(Weekend(DATE(floor([date_id]), 'DD-MM-YYYY')),'DD-MMM-YYYY'), num(weekstart (DATE(floor([date_id]), 'DD-MM-YYYY')),'DD-MMM-YYYY')). This would assign the numeric value of the week start to each of these calculated dimensions and they'd sort numerically.

View solution in original post

1 Reply
Or
MVP
MVP

Several options, but the easiest one would be to use Dual(DATE(weekstart (DATE(floor([date_id]), 'DD-MM-YYYY')),'DD-MMM-YYYY') & ' to '& DATE(Weekend(DATE(floor([date_id]), 'DD-MM-YYYY')),'DD-MMM-YYYY'), num(weekstart (DATE(floor([date_id]), 'DD-MM-YYYY')),'DD-MMM-YYYY')). This would assign the numeric value of the week start to each of these calculated dimensions and they'd sort numerically.