Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Custom Sorting

Hi,

I have month on x-axis and two other metrics for comparison 2013-2014 and 2014-2015. I am trying to create custom sort on x-axis as per Australian calendar which starts from July to June.

I am comparing the Sales Value data here is 2013-2014 and 2014-2015.

But not able to implement custom sorting. Pls let me know.

Thanks,

13 Replies
Not applicable
Author

Can you post a sample qvw???

Anonymous
Not applicable
Author

I would use an Inline table who will be joined to the calendar table

SortMonth:

Load * inline

[Month, SortMonth

July, 1

Aug, 2

...

..

June, 12

]

left join (Calendar)

load Month, Sort

resident SortMonth

and then in the Sort expression of your diagram use the new field SortMonth

juleshartley
Specialist
Specialist

...even better is if you can load it as a dual() and then the sorting is seamless.

eg:

Load dual(a,b) inline

[a , b

July, 1

Aug, 2...

]

Not applicable
Author

To refresh the qvw file it will take 90 minutes, can I do something at the UI level.

Thanks,

Anonymous
Not applicable
Author

you can put the expression in your sort expression:

if (month(yourdate)='July'),1

  if (month(yourdate)='August', 2,

    ....

    if (month(yourdate)='June', 12)

But next time before you refresh your qvw, i would put in the the script

Not applicable
Author

I already have this logic, but not working as expected.

=IF(Month(InvDate)='Jul',1,IF(Month(InvDate)='Aug',2,IF(MonthInvDate)='Sep',3,IF(Month(InvDate)='Oct','4',IF(Month(InvDate)='Nov',5, 

IF(Month(InvDate)='Dec',6,IF(Month(InvDate)='Jan',7,IF(Month(InvDate)='Feb',8,IF(Month(InvDate)='Mar',9,IF(Month(InvDate)='Apr',92,

IF(Month(InvDate)='May',93,IF(Month(InvDate)='Jun',94))))))))))))

Anonymous
Not applicable
Author

maybe to many ifs?

try

 

if (num(month(InvDate))>6, num(month(InvDate))-6, (num(month(InvDate)))+6)

Not applicable
Author

No, didn't worked...

Thanks,

aveeeeeee7en
Specialist III
Specialist III

Hi Madu

Add this is Sort Expression:

Dual(Month,Match(Month,'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'))

Here Month is your MonthFieldName

See the Snapshot:

Sort.bmp

Regards

Aviral Nag