Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
I've tried searching the community, but couldn't find anything answering this simple question.
By using the output of the function MonthStart (used in the script), one can create a scatter chart with a 'YYYY-MM ' string label on the x-axis, AND simultanously have dates in number format as the values for the x-axis. This results in linear, continous x-axis where the distance between data points in the graph is proportional to the time between the two dates (please see the attached picture).
My question is: How to make the same chart, but now with 'YYYY-WW' as the label on the x-axis? The function WeekName returns dual data type (in similarity with MonthStart), but for some reaseon Qlik does not like to display its string value as x-axis label.
Obs! X-axis needs to be continous, the solution is not to make string values such as
Year([$(_DateField)]) & '-' & Week([$(_DateField)]).
Many thanks in advance!
Hi Exciton,
Try adding a calculated dimension like the following. You do this in the dimensions tab under properties.
=date(Year_Week,'YYYY-MM')
Then you can rename the dimension in under label in dimensions.
Regards,
Mike
Dear Mike!
Thank you for your reply! I have tried your suggestion, but it did not resolve the issue, the x-axis labels are still displaying the numerical value corresponding to the timestamp (e.g. 43000).
I believe that the Year-Week field that I calculate by using the WeekName function has the propper return data type, please see:
https://help.qlik.com/enUS/qlikview/12.1/Subsystems/Client/Content/Scripting/DateAndTimeFunctions/we...
The data type should thus not be an issue. In addition, the chart looks as intended when plotting Year-Month, which was created with corresponding function: MonthStart (https://help.qlik.com/en-US/sense/April2019/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTimeFu...)