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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Months on X-axes with week accuracy

Hej

I want to represent revenues over a year with months on the horizontal axis but the curve is smoothened compared to when I uses weeks on the same axis.

My datasource is a timestamp so I wrote in my script:

Directory;
LOAD
Date as Date,
Year(Date) As Year,
Month(Date) As Month,
Week(Date) As Week,
Day(Date) as Day,

I would like to have the curve I get when I use week but with the month caption on the axis.

Thank you for your help.

1 Solution

Accepted Solutions
Not applicable
Author

Thank you for all your answers.

Unfortunately none on them really worked exactly.

What worked finally was using Dual(Month, Week) as a dimension and then sorting by ascending numerical value.

Best regards,

View solution in original post

4 Replies
juleshartley
Specialist
Specialist

There are a few ways that you could achieve this I think. If you simply use the 'date' field on the x axis then you can format it as Date([Date],'MMM-YY') for example... but maintain the detail in the chart

er_mohit
Master II
Master II

Try to conctenate like below in edit script

Week(Date) & ' ' & Month(Date) as Weekmonth

antoinelaviron
Partner - Contributor III
Partner - Contributor III

Hi,

In your chart, in dimension used, use the following calculated dimension:

     Dual( if(     Mod(Month,4)=0,     Month,     null()

                    )

             ,Week

             )

Values of the week will be used in the drawing of the chart but this is the value of the corresponding month that will be displayed on the axis.

if(Mod(Month,4)=0, Month,null())

is used to reduce the number of values of a same month displayed on the axis but I would sugest you to use a flag in your script.

Best,

A.

Not applicable
Author

Thank you for all your answers.

Unfortunately none on them really worked exactly.

What worked finally was using Dual(Month, Week) as a dimension and then sorting by ascending numerical value.

Best regards,