Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

swetha54
New Contributor II

Sorting week which is used in columns in pivot table in qlik sense

Hi All,

Can you please hlep me with the below issue i am facing in qlik sense.

My Week format is WW-MMM ex, 01-Jan

it is used in pivot table columns, while sorting the columns it is not sorting based on weekmonth combination instead there are options to sort alphabetically or number.

Need to write expression for sorting , can any one please help me with this.

1 Solution

Accepted Solutions
Highlighted

Re: Sorting week which is used in columns in pivot table in qlik sense

This should work as a sort expression:

WildMatch(FieldName, '*Jan', '*Feb', '*Mar', '*Apr', '*May', '*Jun', '*Jul', '*Aug', '*Sep', '*Oct', '*Nov', '*Dec')

6 Replies
Highlighted

Re: Sorting week which is used in columns in pivot table in qlik sense

This should work as a sort expression:

WildMatch(FieldName, '*Jan', '*Feb', '*Mar', '*Apr', '*May', '*Jun', '*Jul', '*Aug', '*Sep', '*Oct', '*Nov', '*Dec')

Partner
Partner

Re: Sorting week which is used in columns in pivot table in qlik sense

Apart from nicoles suggestion. Another option is to use dual on your Week field
e.g.
dual(your week month logic, week(CalDate))
Partner
Partner

Re: Sorting week which is used in columns in pivot table in qlik sense

If you are creating weekMonth field from date you could create it as a dual like this and then you can sort the field numerically.

Dual(week(date)&'-'&month(date),
week(date)+(month(date)/100)) as Week

(I'm courious, why do you use week and month in your field, many weeks splits into two different months and you'in end up with weeks containing less than 7 days)
Plees ekskuse my Swenglish and or Norweglish spelling misstakes
swetha54
New Contributor II

Re: Sorting week which is used in columns in pivot table in qlik sense

Thanks for your reply.

But this is not the case, no need to derive week from date.

swetha54
New Contributor II

Re: Sorting week which is used in columns in pivot table in qlik sense

Hi Nicole,

This experession is sorting by months but not weeks in the same month.

Can you please suggest how weeks also can be sorted.

swetha54
New Contributor II

Re: Sorting week which is used in columns in pivot table in qlik sense

Hi All,

My issue is resolved as i have used both sorted by expression and sorted by alphabetic.

Thank you all for your valuable responses.