Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

sparur
Valued Contributor 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

How get Zero Values for Missing data on a bar chart

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

sparur
Valued Contributor II

How get Zero Values for Missing data on a bar chart

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

chauhans85
Esteemed Contributor

Re: How get Zero Values for Missing data on a bar chart

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

and supress null

presentation -> zero on bar

see the attached file for details

sparur
Valued Contributor II

How get Zero Values for Missing data on a bar chart

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?

dennisnet
Valued Contributor III

Re: How get Zero Values for Missing data on a bar chart

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

Re: How get Zero Values for Missing data on a bar chart

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

dennisnet
Valued Contributor III

Re: How get Zero Values for Missing data on a bar chart

Nice solution Bruno.

I am going to save that one :-)

Not applicable

Re: How get Zero Values for Missing data on a bar chart

Haha, You're welcome

bm59
New Contributor III

Re: How get Zero Values for Missing data on a bar chart

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...

Community Browser