Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
chibi
Creator
Creator

Show 0 values in graph

I'm trying to display the graph below to show 0 values but somehow it's not showing below. Can somone help me please. I enabled display 0 values in data handling and even included the date comparison dimension to include null values but it's not showing for the month of june, july and august where there are no sales. 

chibi_0-1641367677453.png

 

Can someone help to explain what I'm missing? 

 

1 Solution

Accepted Solutions
chibi
Creator
Creator
Author

Okay I found out why it does not work. I have a section access so I had to create a new reduction called reductiondate and add an 'ALL' function for the Date. 

View solution in original post

4 Replies
AshutoshBhumkar
Partner - Specialist
Partner - Specialist

Hello,

You need to generate the master calendar to populate the dates and months to show those 0 sales values.

https://community.qlik.com/t5/Qlik-Sense-Documents/Understanding-the-Master-Calendar-video/ta-p/1479...

 

Thanks,

Ashutosh

chibi
Creator
Creator
Author

Thanks for the link! Let me try this out and get back to you. Thank you so much 

chibi
Creator
Creator
Author

So I follow the script from the link and change it according to my tables. But I still have the same result. Where am I going wrong? 

chibi_0-1641372763549.png

chibi_1-1641372801677.png

Script from master calendar: 

QuartersMap:
MAPPING LOAD
rowno() as Month,
'Q' & Ceil (rowno()/3) as Quarter
AUTOGENERATE (12);

Temp:
Load
min("Date") as minDate,
max("Date") as maxDate
Resident i_fact_sales_agg;

Let varMinDate = Num(Peek('minDate', 0, 'Temp'));
Let varMaxDate = Num(Peek('maxDate', 0, 'Temp'));
DROP Table Temp;

TempCalendar:
LOAD
$(varMinDate) + Iterno()-1 As Num,
Date($(varMinDate) + IterNo() - 1) as TempDate
AutoGenerate 1 While $(varMinDate) + IterNo() -1 <= $(varMaxDate);

MasterCalendar:
Load
TempDate AS "Date",
week(TempDate) As Week,
Year(TempDate) As Year,
Month(TempDate) As Month,
Day(TempDate) As Day,
ApplyMap('QuartersMap', month(TempDate), Null()) as Quarter,
Week(weekstart(TempDate)) & '-' & WeekYear(TempDate) as WeekYear,
WeekDay(TempDate) as WeekDay
Resident TempCalendar
Order By TempDate ASC;
Drop Table TempCalendar;

 

Data Model: 

chibi_2-1641372914530.png

 

 

chibi
Creator
Creator
Author

Okay I found out why it does not work. I have a section access so I had to create a new reduction called reductiondate and add an 'ALL' function for the Date.