Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
sparur
Specialist II
Specialist II

How get Zero Values for Missing data on a bar chart

Hello, guys

I have some problems with my bar chart.

I want to get zero values on X-axis for missing data.

Please see in my attached example.

How I can resolve my trouble?

Thanks for your advices

15 Replies
Not applicable

in your chart select the year dimension and click on show all values

sparur
Specialist II
Specialist II
Author

Unfortunately, it's not a simple as we want...

It's not help me, because I need only 3 last years in my chart (I use a set analysis expression for it)

and If I check on this option (show all values) I will get not beautiful result

SunilChauhan
Champion
Champion

dimension -> select Year-> show all values check it

and supress null

presentation -> zero on bar

see the attached file for details

Sunil Chauhan
sparur
Specialist II
Specialist II
Author

thanks, Sunil.

but I can't use "Show all values" option, because I need view only 3 last year: 2009, 2010 and 20011 only.

Show all values - show me more older years, I don't need in it.

Somebody has any other ideas?

Anonymous
Not applicable

Maybe this is a solution for you:

If you only need the values of the last 3 years, why not add this in your script?

     Let vCurrentYear = Year(today());

     Let vNumberofYearsBack = 2;

     Load * Inline[...

     ...

     ]

     Where Year <=$(vCurrentYear)

     And Year >= ($(vCurrentYear) -$(vNumberofYearsBack)) ;

But this only works if you don't need the older values at all.

Not applicable

Without changes in script.

Only a new variable and some changes in expression.

First: Create a new variable called 'V_Channel' with this expression:

=chr(39) & replace(Concat(DISTINCT Channel, '","'), '"', chr(39)) & chr(39)

Second: Change the main expression in the chart to this one:

sum({1<Year = {">=$(=varMaxYear-2)"}>} if(WildMatch(Channel, $(V_Channel)) > 0, Value, 0))

And... it works!

Regards,

Bruno

Anonymous
Not applicable

Nice solution Bruno.

I am going to save that one 🙂

Not applicable

Haha, You're welcome

bm59
Contributor III
Contributor III

Hi,

I have the same problem, and I try your trick, it doesn't work for me.

You can see my exemple on attached file

The pivot table at the bottom is your trick, but the missing sales doesn't appear (July) and a column month '-' come at the right.

Can you or anyone help me? plz

Sorry for my english...