Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
zhaohaifeng
Contributor III
Contributor III

Custom sorting issue

Hi All,

Now we faced the challenga as below regarding custom sorting, sometimes sorting not works.

For dimension,

if(GetFieldSelections(Periods)='Qtr',Qtr,[M o n t h])

Sorting:

We try both of below two ways, all of them sometimes not works,

if(GetFieldSelections(Periods)='Qtr',QUARTER_SK,

MONTH_NUMBER))

QUARTER_SK----- for example 201501, valus was 01, 201502 value was 01, 201504 value was 02, 201601 value was 05....

MONTH_NUMBER--For example 201501 value was 01, 201502 value was 02, 201601 value was 01,201602 value was 02.....

if(GetFieldSelections(Periods)='Qtr',

Match(Qtr,'Q1','Q2','Q3','Q4'),

Match([M o n t h],'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'))

Both of them sometime not works, i dont know which part ran wrong ,

Is there any way I can do this custom sorting? Thanks.


Best Regards,

Haifeng

2 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Test the two parts of the sort expression in text boxes -

Does Match(Qtr,'Q1','Q2','Q3','Q4') work as expected when you select a single possible value for Qtr", and

does Match([M o n t h],'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec')) work correctly when you select a single value of [M o n t h]? This may help pin down the problem.

Also be aware that if nothing is selected, then f(GetFieldSelections(Periods)='Qtr', will always return false.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
zhaohaifeng
Contributor III
Contributor III
Author

Thanks Man.

I checked in my end, it work correctly.

whats confusion was that, juts sometimes sort not works, For the same default selections, sometimes works fine but sometimes not works. Thanks.