Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
jp_afc
Contributor II
Contributor II

Count of incidents reported per day that are 0 but do not show on a table

I have a list of incidents that have been reported each day since 2014. I want to create a table that shows the number of incidents that were reported each day. First column will be the date and the second column will show the count of incidents reported on that date. There are some days where they was no incidents reported but I still need that date to show up on the first column and the count in the second column to show as 0. How would I go about doing this? I have already ticked the part that says 'Include null values'

Labels (1)
1 Solution

Accepted Solutions
marcus_sommer

In many scenarios it's the easiest way to populate such missing data, for example with something like:

t: load Incidents, Date, Date as DateForExists from X;
concatenate(t) load 'none' as Incidents, Date
resident Calendar where not exists(DateForExists, Date); 

Instead of none you may need zero or null() and adding an extra source-information about native/populated data is also often helpful.

View solution in original post

1 Reply
marcus_sommer

In many scenarios it's the easiest way to populate such missing data, for example with something like:

t: load Incidents, Date, Date as DateForExists from X;
concatenate(t) load 'none' as Incidents, Date
resident Calendar where not exists(DateForExists, Date); 

Instead of none you may need zero or null() and adding an extra source-information about native/populated data is also often helpful.