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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Cori
Contributor II
Contributor II

Pick(Match()) Expression showing monthnumbers instead of names

Hi all,

I'm already using a field "Monat" as dimension in several tables and charts and it's showing in "Jan.", "Feb.", ... as preset in the SET MonthNames function in the script.
In LOAD script defined as: month(Field1) as Monat

However, I'm now trying to use it in the following expression to switch between year and month perspective but the chart will only show monthnumbers (1-12) instead of monthnames.

=Pick(Match($(vVariable1),1,2),Jahr,Monat)

I tried changing it to Month(Monat) but that results in only showing month "1" and "12"

Can someone help me getting the months to show as names and maybe explain why it's working when using as a "normal" dimension but not in this specific Pick(Match()) expression?

Thanks in advance!

Labels (2)
1 Solution

Accepted Solutions
Or
MVP
MVP

Not really sure why you're not getting the same behavior I am - I included the code I tested with and as you can see the month is returned as text.

Have you tried using Text(Monat)?

View solution in original post

4 Replies
Or
MVP
MVP

I tried replicating what you described, but I am getting the month names in both the dimension and measure when used in Pick(Match()):

Load Month(Date) as Monat, 2022 as Jahr;
Load Date(Today()-RecNo()) as Date Autogenerate 150;

Or_1-1660212806944.png

If you're using a line chart or another chart that allows this, you may have a Continuous X-axis enabled, in which case numeric values will always be used and considered continuous. If so, you should disable that setting:

Or_2-1660212890558.png

 

 

 

 

 

Cori
Contributor II
Contributor II
Author

Thanks for your reply!
I am using a bar chart and tried disabling the continous x-asis as you suggested. Unfortunately the outcome is still the same, the months are shown as numbers. I also recreated the table with dimension and expression, but I get the following result, dimension showing in numbers and expression showing in names.

Table1.JPG

Or
MVP
MVP

Not really sure why you're not getting the same behavior I am - I included the code I tested with and as you can see the month is returned as text.

Have you tried using Text(Monat)?

Cori
Contributor II
Contributor II
Author

Text(Monat) worked perfectly!

I also still don't understand why I get different results, but it doesn't matter since you offered an alternative solution 😊

Thank you so much!