Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
vvira1316
Specialist II
Specialist II

How to get sort for MonthYear Axis using Expression/Text/Numeric check option to work

Hi,

I'm not sure why sort is not working as intended in following scenario

Dimension Expression

=Month(Date([Date of Review],'MM/DD/YYYY')) & ' ' & Year(Date([Date of Review],'MM/DD/YYYY'))

MonthYearText_SortNotWorking.png

Sort Tab

SortTab1.png

The expression on Sort Tab is

=Num#(Year(Date([Date of Review],'MM/DD/YYYY')) & If(Len(Match(Month(Date([Date of Review],'MM/DD/YYYY')), $(=chr(39) & Replace(MonthNames, ';', chr(39) & ',' & chr(39)) & chr(39))))=1,
'0'&
Match(Month(Date([Date of Review],'MM/DD/YYYY')), $(=chr(39) & Replace(MonthNames, ';', chr(39) & ',' & chr(39)) & chr(39))),Match(Month(Date([Date of Review],'MM/DD/YYYY')), $(=chr(39) & Replace(MonthNames, ';', chr(39) & ',' & chr(39)) & chr(39))))
,'######')

Now if I change Dimension expression to

=Num#(Year(Date([Date of Review],'MM/DD/YYYY')) & If(Len(Match(Month(Date([Date of Review],'MM/DD/YYYY')), $(=chr(39) & Replace(MonthNames, ';', chr(39) & ',' & chr(39)) & chr(39))))=1,
'0'&
Match(Month(Date([Date of Review],'MM/DD/YYYY')), $(=chr(39) & Replace(MonthNames, ';', chr(39) & ',' & chr(39)) & chr(39))),Match(Month(Date([Date of Review],'MM/DD/YYYY')), $(=chr(39) & Replace(MonthNames, ';', chr(39) & ',' & chr(39)) & chr(39))))
,'######')

and Sort Tab as follows

SortTab2.png

then I get correct sort order on chart axis as can be seen in following screen shot.

MonthYearNumeric_SortWorking.png

I will appreciate any help / guidance

1 Solution

Accepted Solutions
shraddha_g
Partner - Master III
Partner - Master III

Just Try with Monthstart field if you have.

else Monthstart(Date([Date of Review],'MM/DD/YYYY'))

View solution in original post

3 Replies
Not applicable

try:

=aggr(

Num#(Year(Date([Date of Review],'MM/DD/YYYY')) & If(Len(Match(Month(Date([Date of Review],'MM/DD/YYYY')), $(=chr(39) & Replace(MonthNames, ';', chr(39) & ',' & chr(39)) & chr(39))))=1,
'0'&
Match(Month(Date([Date of Review],'MM/DD/YYYY')), $(=chr(39) & Replace(MonthNames, ';', chr(39) & ',' & chr(39)) & chr(39))),Match(Month(Date([Date of Review],'MM/DD/YYYY')), $(=chr(39) & Replace(MonthNames, ';', chr(39) & ',' & chr(39)) & chr(39))))
,'######')

,[Date of Review])

shraddha_g
Partner - Master III
Partner - Master III

Just Try with Monthstart field if you have.

else Monthstart(Date([Date of Review],'MM/DD/YYYY'))

vvira1316
Specialist II
Specialist II
Author

Hi Shraddha,

It resolved once I used =MonthName(Date([Date of Review],'MM/DD/YYYY')) in dimension and Numeric Value in sort.

Thanks for your input.

Regards,

Vijay