Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
colinodonnel
Creator II
Creator II

left align dates

Hello all,

Hopefully there is a solution to this that I have overlooked.

I note that:

A: Qlik Sense automatically left aligns Text and right aligns Dates and Numbers.

B: The reason why Dates are right aligned is because of the Dual function which stores Dates as a text string to be displayed and a number for processing and sorting the order.

I have been able to convert a date to a text so that it Left Aligns using the following function in the script:

Text (Date("Date",'MMMM'))  as "Month",


This means that visually, the filter planes all line up as they should as follows:

Month.png

The problem now is the order is now out of sync  as the text is now sorted alphabetically.

How can I arrange the order of the text?

Perhaps add a preceding number or some other character to the text? This preceding number/character would need to remain invisible.

I have tried playing with the Dual function, but when I apply a number to the text, it gets right aligned again.

Many thanks,

Colin

4 Replies
YoussefBelloum
Champion
Champion

Hi,

would you be able to attach the QVF ?

otherwise, try this on the sorting:

=min(Date)  ==> ascending


or


=Max(Date) ==> descending

ChennaiahNallani
Creator III
Creator III

go with custom sort with expression.

=match (Month, 'Jan', 'Feb', '....)

colinodonnel
Creator II
Creator II
Author

Hi Youssef,

Thank you for the reply.

Your reference to Sort directed me to the Sorting Area.

I edited the Filter Pane.

When to Sorting and changed it to "Sort Numerically".

It has now put the Text in the correct order.

I don't understand why this has worked but it has.

So in essence, it is now solved and this is now a solution

Best Regards,

Colin

colinodonnel
Creator II
Creator II
Author

Hi Chennaiah,

Yes I have just tried your solution and it works as well.

The full expression is:

=match(Month, 'January', 'February','March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December')

Thank you,

Colin