Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I use the monthname function to convert a date to a month and the monthname does not get displayed in a line chart if I change the x-axis to be on continuous scale. But works fine on a BAR chart or TABLE box.
Is there a workaround for this?
kha mtorajamohan isaaclin chooco_co
LINE CHART: x-axis is continuous, whereas I need a month name
BAR CHART: x-axis is fine
TABLE BOX: x-axis is fine
Would you be able to share a sample to look at?
Sure, hereby attached a sample of the problem.
It works without the continuous axis, but while going to alternate dimension of date it shows the first date instead of entire range
To use the continuous axis with month labels you need to create an autocalendar in the script, as that's where the labels for the axis are generated. This can be done by either loading in your excel file through the Data manager or by adding an autocalendar to your script.
Here is the script you can add.
[autoCalendar]:
DECLARE FIELD DEFINITION Tagged ('$date')
FIELDS
Dual(Year($1), YearStart($1)) AS [Year] Tagged ('$axis', '$year'),
Dual('Q'&Num(Ceil(Num(Month($1))/3)),Num(Ceil(NUM(Month($1))/3),00)) AS [Quarter] Tagged ('$quarter', '$cyclic'),
Dual(Year($1)&'-Q'&Num(Ceil(Num(Month($1))/3)),QuarterStart($1)) AS [YearQuarter] Tagged ('$yearquarter', '$qualified'),
Dual('Q'&Num(Ceil(Num(Month($1))/3)),QuarterStart($1)) AS [_YearQuarter] Tagged ('$yearquarter', '$hidden', '$simplified'),
Month($1) AS [Month] Tagged ('$month', '$cyclic'),
Dual(Year($1)&'-'&Month($1), monthstart($1)) AS [YearMonth] Tagged ('$axis', '$yearmonth', '$qualified'),
Dual(Month($1), monthstart($1)) AS [_YearMonth] Tagged ('$axis', '$yearmonth', '$simplified', '$hidden'),
Dual('W'&Num(Week($1),00), Num(Week($1),00)) AS [Week] Tagged ('$weeknumber', '$cyclic'),
Date(Floor($1)) AS [Date] Tagged ('$axis', '$date', '$qualified'),
Date(Floor($1), 'D') AS [_Date] Tagged ('$axis', '$date', '$hidden', '$simplified');
DERIVE FIELDS FROM FIELDS [date] USING [autoCalendar] ;
Result using YearMonth, but you can also use Month.
Hi Vinol,
It's better you create master calendar and put your dimension there.
You can use script by Partrick or check this link
Creating a Master Calendar - YouTube
Regards,
Hi Vinol,
Uncheck the option, 'Use continuous scale' under Appearance section to resolve this issue
Hi Vinol,
You may try the following expression:
=Month(date) & ' ' & Year(date)
Regards,
Jomar