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: 
drohm002
Creator
Creator

Sort by expression

Hi, I have a field called TIME, which has values like '730am-8am', '8am-830am', etc.  How can i create an expression to sort these so that they show up in my table chart in chronological order?  thank you!  None of the default sort suggestions would put the values in chronological order...

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It'a a little awkward because you have to account for the various formats, but how about a sort expression like:

=Time(
  Alt(
    Time#(SubField(TIME,'-',1),'htt'),
    Time#(SubField(TIME,'-',1),'hmmtt'),
    Time#(SubField(TIME,'-',1),'hhmmtt')
  )
)

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

View solution in original post

1 Reply
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It'a a little awkward because you have to account for the various formats, but how about a sort expression like:

=Time(
  Alt(
    Time#(SubField(TIME,'-',1),'htt'),
    Time#(SubField(TIME,'-',1),'hmmtt'),
    Time#(SubField(TIME,'-',1),'hhmmtt')
  )
)

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com