Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
amien
Specialist
Specialist

master calender and chart issue

i havea master calender with all months of past 5 years. My data only contains in some months no data (for example no one got hired that month).

if that is the case, i still need to see that month (there will be an empty spot in the a bar chart).

how can i do this?

when i select only two years .. and then i check 'suppres zero-values' all months will be shown, but also from the years that are not selected.

6 Replies
johnw
Champion III
Champion III

See attached example. Here's the basic approach:

1. In script, if any values are missing, create a new table with all values of the dimension you want to see the zeroes for
2. On dimensions tab, show all values
3. On presentation tab, uncheck suppress zero-values, uncheck suppress missing
4. On axes tab, checkmark continuous, set static min to min(Dimension), static max to max(Dimension)

In practice, I usually subtract a small amount from the min and add a small amount to the max so that symbols will show and so that if only a single value is selected, it still has some idea what sort of X-axis scale I want.

amien
Specialist
Specialist
Author

evening John .. Thanks for your reply .. seems all good .. only 1 issue .. when i change your chart from line to bar .. its all stacked .. how can i unstack?

johnw
Champion III
Champion III

Ah, the continuous X-axis is apparently incompatible with "grouped" bars. With a group, the position along the X axis indicates the group. But with a continuous X-axis, everything in the group is placed at the same point, so they overlap. It's not even stacked. It's just useless junk.

It also doesn't seem to want to display the bars unless you have some slack on either side, so you'll need something like min(Date)-.5 and max(Date)+.5, which is what I'd normally do anyway.

If you don't need a second dimension, simply removing the second dimension at that point makes the bars display OK.

If you DO need a second dimension, then you'll have to stack them on the Style tab. Grouped doesn't work.

amien
Specialist
Specialist
Author

i need 1 dimension and 2 expressions 🙂

johnw
Champion III
Champion III

In that case, same problem, same solution. You can't show the bars grouped on a continuous axis - they just overlay each other. You need to stack them. If that won't do because you NEED them grouped instead of stacked, I don't know how to handle it. Perhaps a line chart instead of a bar chart? Sorry, no idea.

amien
Specialist
Specialist
Author

how about this one ..

or use a IF statement with Date in the dimension.

something like this :=IF(RIGHT(Date,4)=GetFieldSelections(Year),Date)