Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sharonq
Contributor
Contributor

change starting values on X-axis

Hi everyone, 

I'm new to qliksense but have progressed somewhere and benefitted greatly from this community board. I have a question for bar charts axis below. My data starts from 29 - 57, and I have arranged it to be grouped in classes of 5. I would like for the data to start at 29, i.e. the first bar should say 29-34 instead of 25-30, as it could mislead that 25 is acceptable (as it is not). Could anyone help me with this? thank you!

sharonq_0-1629707240275.png

 

Labels (1)
  • Chart

1 Solution

Accepted Solutions
Andrea_Spinetti
Former Employee
Former Employee

Hi @sharonq, sorry my bad, I think I've missed a part of your post 😅 In this case (giving that you have an example field "Age" and an example field "YearsOfExp") setting the Dimension and the Measure this way in the Bar Chart should help you:

 

- Set the Dimension as Class(Age,5,'x', 4) (where the number 4 represents the offset) to create the correct intervals.

- Set the Measure as follows: Avg({$<Age={">28"}>}YearsOfExp). This expression uses Set Analysis to select values only above 28 of the field 'Age'.

 

You can check also the attached screenshot. Let me know if this solved your issue 😊

 

If the issue is solved please mark the answer with Accept as Solution.

View solution in original post

5 Replies
Andrea_Spinetti
Former Employee
Former Employee

Hi @sharonq! If I got your request right, you could solve your issue by setting the "offset" field to "4" and the "Width" to "5".

 

Let me know if this helped you! 🙂

 

Cheers!

 

If the issue is solved please mark the answer with Accept as Solution.
sharonq
Contributor
Contributor
Author

Hi @Andrea_Spinetti 

Thank you for your comment! I am looking at creating a graph/chart that shows average work experience in the age groups of 29-34, 35-40, 41-46, 47-51, 52 and beyond. Not sure if Histogram is the right way.. 

Andrea_Spinetti
Former Employee
Former Employee

Hi @sharonq, sorry my bad, I think I've missed a part of your post 😅 In this case (giving that you have an example field "Age" and an example field "YearsOfExp") setting the Dimension and the Measure this way in the Bar Chart should help you:

 

- Set the Dimension as Class(Age,5,'x', 4) (where the number 4 represents the offset) to create the correct intervals.

- Set the Measure as follows: Avg({$<Age={">28"}>}YearsOfExp). This expression uses Set Analysis to select values only above 28 of the field 'Age'.

 

You can check also the attached screenshot. Let me know if this solved your issue 😊

 

If the issue is solved please mark the answer with Accept as Solution.
albertovarela
Partner - Specialist
Partner - Specialist

Hello there, 

The age groups you listed are not even; some have 6 values (29-34, 35-40)  and some 5 (41-46, 47-51)... anyhow I think the key for you is to set the 4th argument to 29

Assuming the class size is 6 use: class(Age,6,'x',29)

 

2021-08-23_17-09-41.png

 

sharonq
Contributor
Contributor
Author

Thank you! this worked well!!!