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: 
tenyeapen
Contributor
Contributor

Bar Chart + Null

In a bar chart i have to select data from 2 feilds namely year and month. but if i select year 2019 and month december (this search doesnt have any value), the chart will show the value for all decmeber cases in theprevious months. How to avoid this?

2 Replies
rubenmarin

Hi, maybe there is no row with year 2019 and month dec, if you select 2019 and december has a grey background that means that there is no relation between those fields values, so Qlik removes one (or many) selections to allow you to select month december.

Maybe cerating a maester calendar so at least there is a relation between 2019 and december, one.

Here is one way of doing it:

Calendar:
LOAD
IdDate as IdDate,
Date(IdDate) as Date,
Month(IdDate) as Month,
Year(IdDate) as Year
;
LOAD
AddMonths(MinDate, IterNo()-1) as IdDate
While AddMonths(MinDate, IterNo()-1) <= MaxDate
;
LOAD
YearStart(Min(FieldValue('IdDate', RecNo()))) as MinDate,
Floor(YearEnd(Max(FieldValue('IdDate', RecNo())))) as MaxDate
AutoGenerate FieldValueCount('IdDate')
;

// change IdDate to your current date field, you can create one using "Makedate(YearField, MonthField) as IdDate"
tenyeapen
Contributor
Contributor
Author

It didn't went correctly.. 😞