Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Creating a histogram with fixed / static X-axis

Hi,

I've created a histogram of an age distribution with the following function

=Class(Aggr(birthyear ,birthyear), 5 , 'j', 1900)

It works fantastically except for two problems:

1) If the selection does not contain people in that agebucket the bucket is ommitted completely. This means that every time I make a selection the X-axis changes, making it hard to read. How do I make the X-axis fixed / static?

2) I'm comparing two expressions (the age distribution of the selected group, compared to that of the all the groups).

A) Count (DISTINCT NR_REL_VZD)

B) Count (DISTINCT {$<GROUP = >} NR_REL_VZD)

Unfortunately, the buckets that the Class(Aggr) function creates are based only on the selection. That means that values from the second expression B that fall outside the buckets of the first expression A are not included in the histogram and put in a seperate bucket with a blank label. Again, if I can make the X-axis static I can fix this.

Checking / unchecking "suppress zero values" and "suppress missing / show all values" does not work (i.e. still have problem 1 and 2). Using a continuous axis seems to work, but then the two expressions (it's a bar graph) obscure eachother as the bars cannot be plotted next to eachother.



Does anyone know how i can make the X-axis static or have another solution to the above problem?

Thanks in advance!

NOTE: I'm using the trail versions, so unfortunately i cannot cannot download any qvw's you post.

1 Solution

Accepted Solutions
Not applicable
Author

Kristoffer,

Thanks for your offer. In the meanwhile I solved my problem in the following way:

I created an extra table with in one column the X-axis value and in the other the desired bucket category for the histogram I was making. I then loaded it with "partial reload" and selected it as my X-axis dimension. Voila, solved!

If anyone knows a smarter / quicker solution, I'd be happy to hear!

View solution in original post

2 Replies
Not applicable
Author

Can you post a qvw file showing your example?

Not applicable
Author

Kristoffer,

Thanks for your offer. In the meanwhile I solved my problem in the following way:

I created an extra table with in one column the X-axis value and in the other the desired bucket category for the histogram I was making. I then loaded it with "partial reload" and selected it as my X-axis dimension. Voila, solved!

If anyone knows a smarter / quicker solution, I'd be happy to hear!