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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
anjali0108
Partner - Creator III
Partner - Creator III

Sort Monthname,year and week number n dimension

Dear Experts,

I have a dimension like this as shown below:

Capture1.JPG

I want to sort this field.

Could anyone help me in this ?

I tried sorting in expression too but not able to get the desired sorting.

Thanks in advance...

10 Replies
sunny_talwar

That is weird... but okay. Can you run the below script

Common:
LOAD *,
Dual(MonthName(CommonDate) & '- Week' & ' ' & WeekNumberInMonth, (MonthName(CommonDate)*100 + WeekNumberInMonth)) as WeekNoAndMonth,

MonthName(CommonDate) & '- Week' & ' ' & WeekNumberInMonth as Temp;

LOAD *,
if((week(CommonDate) - week(monthstart(CommonDate)) + 1)<1,1,(week(CommonDate) - week(monthstart(CommonDate)) + 1)) as WeekNumberInMonth;

LOAD *,
MakeDate(CommonYear,CommonMonth,CommonDays) as CommonDate

FROM
$(AppQvdPath)Common.qvd
(qvd);

and create a table box with two fields

1) Temp

2) WeekNoAndMonth