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: 
shanky1907
Creator II
Creator II

Calendar error

Hello,

I have an issue with the application as there is a cross table expression from that date field(Not a proper date field, just for time representation) is taken.

the format of date field is like this

201501

201502

201503...12

2016Q1

2016Q2...Q4

2017

2018

2019

On this filed, i need to sort a chart in ascending order of time. But i cant as it is not showing proper date stmap.

Please help finding any solution.

Thanks in advance.

5 Replies
Clever_Anjos
Employee
Employee

Text Order will handle proper sorting

shanky1907
Creator II
Creator II
Author

I tried Text Order Sorting. But its also not giving correct order.

Clever_Anjos
Employee
Employee

maxgro
MVP
MVP

1.png



a:

load

dual(field,

     if(len(field)=4, date(MakeDate(field)),

     if(isnum(field), date(MakeDate(Left(field,4), num(Right(field,2)))),

     MakeDate(Left(field,4), div(Right(field,1),3)+1

     )))) as field

inline [

field

2016Q1

2016Q2

2016Q3

2016Q4

2019

201501

201502

201503

201504

201505

201506

201507

201508

201509

201510

201511

201512

2017

2018

];

shanky1907
Creator II
Creator II
Author

Thanks for the explanation massimo.

I have tried 'Match' in the expression for sorting and got the right order for all the values as required.

Exp:

=Match (expr, vlaue1, value2,......value10)

Here,

Value1 will be given index# 1, value2 will be given index# 2 and so on.

So, by keeping this expression in ascending order had worked for me.