Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
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.