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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Karthick30
Creator
Creator

How to show all 12 months in Dimension by default

Hi,

 I am creating 2 line charts which has Month in Dimension and Measure as sum(value) for 2021 and 2022. For 2021, I have data for all 12 months, but 2022 has only 3 values , hence all other months ignored in chart.

But is there anyway we can by default show all 12 months for 2022 and show value only if data is there.

Karthick30_0-1654880180683.png

 

Labels (1)
1 Reply
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @Karthick30 

This can be a bit  fiddly, but should be possible.

What you need to do is ensure that each possible month is shown regardless of selections. Selections can be ignored by using the set analysis syntax {1}, but obviously you don't want to change the values, and multiplying by 0 will achieve that.

The expression will therefore be:

sum(value) + (sum({1}value)*0)

The problem you then have is that the line will show along at zero. You can potentially hide the line by colouring by an expression, something like:

=if(alt(sum(value),0) = 0, argb(255,255,255,255))

It will also force the Y axis to go from zero. Multiplying by null() rather than zero may work.

I tend to try and let Sense do what Sense wants to do, rather than forcing its hand. I learnt long ago that this can often make things much easier!

Hope that helps.

Steve