Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
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)?
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;
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:
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.
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)?
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!