Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem w line graph Year and week at x axis

Hi!

I got a problem with a line graph. I got a three column table - Year, Week and Sales Amount. Now I want to display the sales amount per week as i line graph with the year and week at the x axis.

I add a line chart to the sheet, select "Year" and "Week" as dimensions and sum(sales) as an expressions, and I get a graph that plots every single week as a separate line - 52 lines per year! The weeks somehow end up like categories.

Obviusly, what i want is one line with 52 data points every year.

What am i doing wrong?

error loading image

My data:

LOAD * INLINE [
Year, Week, Sales
2009, 1, 8
2009, 2, 6
2009, 3, 10
2009, 4, 13
2009, 5, 6
2009, 6, 5
2009, 7, 8
2009, 8, 5
2009, 9, 10
2009, 10, 13
2009, 11, 18
2009, 12, 14
2009, 13, 16
2009, 14, 22
2009, 15, 25
2009, 16, 22
2009, 17, 23
2009, 18, 14
2009, 19, 27
2009, 20, 29
2009, 21, 27
2009, 22, 17
2009, 23, 25
2009, 24, 19
2009, 25, 33
2009, 26, 32
2009, 27, 22
2009, 28, 33
2009, 29, 29
2009, 30, 29
2009, 31, 26
2009, 32, 36
2009, 33, 38
2009, 34, 35
2009, 35, 43
2009, 36, 44
2009, 37, 37
2009, 38, 36
2009, 39, 47
2009, 40, 48
2009, 41, 45
2009, 42, 42
2009, 43, 51
2009, 44, 51
2009, 45, 55
2009, 46, 55
2009, 47, 46
2009, 48, 47
2009, 49, 57
2009, 50, 48
2009, 51, 46
2009, 52, 48
2010, 1, 9
2010, 2, 7
2010, 3, 5
2010, 4, 7
2010, 5, 9
2010, 6, 6
2010, 7, 9
2010, 8, 18
2010, 9, 13
2010, 10, 16
2010, 11, 20
2010, 12, 20
2010, 13, 23
2010, 14, 15
2010, 15, 10
2010, 16, 16
2010, 17, 23
2010, 18, 13
2010, 19, 25
2010, 20, 20
2010, 21, 23
2010, 22, 31
2010, 23, 31
2010, 24, 25
2010, 25, 26
2010, 26, 33
2010, 27, 37
2010, 28, 28
2010, 29, 37
2010, 30, 29
2010, 31, 40
2010, 32, 31
2010, 33, 29
2010, 34, 34
2010, 35, 30
2010, 36, 44
2010, 37, 34
2010, 38, 33
2010, 39, 46
2010, 40, 48
2010, 41, 47
2010, 42, 42
2010, 43, 53
2010, 44, 51
2010, 45, 43
2010, 46, 54
2010, 47, 48
2010, 48, 45
2010, 49, 57
2010, 50, 55
2010, 51, 52
2010, 52, 59
];

1 Solution

Accepted Solutions
Not applicable
Author

You can load the week-number in this format: '2009-52' and use that as a dimension.

View solution in original post

5 Replies
Not applicable
Author

You can load the week-number in this format: '2009-52' and use that as a dimension.

pover
Luminary Alumni
Luminary Alumni

Just switch the order of your dimesions. In the dimensions tab promote the Week dimension so it is the first dimension in the list so that it appears in the x-axis and the second dimension is listed in the legend.

Regards.

Not applicable
Author

Thanks, but that way, the chart will display two lines, one for each year, I just want one single line,

Not applicable
Author

That works, I have a followup question though, how can I set a static step, without making the X axis continous?

If I don´t use a continous x axis the chart shows all week labels, making the chart messy. If I use a continous X axis with a static step, the chart will display weeks 54-100...

pover
Luminary Alumni
Luminary Alumni

Good question. In the line chart QlikView doesn't seem to give you control over how many labels you want to put for every so many data points. It automatically puts as many as it can unless you declare the dimension continuous.

I don't know if it works in your case, but take a look at Dimension Limitations in the Presentation tab where you can limit the number of data point and put a scrollbar.

Curiously, QlikView does let you control the labeling more in the gauge chart.

Regards.