Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
tchovanec
Creator II
Creator II

Add Missing Values

What I am trying to do is show a date by hour. The end result would look like the following. I also tried the example in the cookbook, but it does not work because I have way too much data. I have over 1 million rows that I need to do this for.

INTERVALTOTAL
0045 - 014538
0145 - 024535
0245 - 034526
0345 - 044519
0445 - 05450
0545 - 06450
0645 - 07450
0745 - 084518
0845 - 094527
0945 - 104529
1045 - 114535
1145 - 124532
1245 - 134540
1345 - 144538
1445 - 154537
1545 - 164543
1645 - 174553
1745 - 184561
1845 - 194563
1945 - 204557
2045 - 214561
2145 - 224554
2245 - 234543

The issue I am running into is that when I have 0 it is not showing the interval. I also can't uncheck supress 0 values because then it shows everything and not just the dates I have chosen. Here is what I have so far. This gets me everything I want except for the 0 values are not showing.

TEMP_MIN_MAX_DATES:LOAD
    
MIN(CONVERTED_ADT_ARRIVAL_TIME) as MIN_ADT_ARRIVAL_TIME,
    
MAX(CONVERTED_ADT_ARRIVAL_TIME) as MAX_ADT_ARRIVAL_TIMERESIDENT ED_EVENT_INFO;
LET vMinDate=peek('MIN_ADT_ARRIVAL_TIME',-1,'TEMP_MIN_MAX_DATES');LET vMaxDate=peek('MAX_ADT_ARRIVAL_TIME',-1,'TEMP_MIN_MAX_DATES');DROP TABLE TEMP_MIN_MAX_DATES;


TempCalendar:LOAD//TimeStamp($(vMinDate) -(1395/1440) + ((RecNo()-1)/24) + (IterNo() -1)) AS STARTTimeStamp($(vMinDate) + 3/96  + ((RecNo()-1)/24) + (IterNo() -1)) AS StartDTTM
,
TimeStamp(($(vMinDate) + 3/96  + ((RecNo()-1)/24) + (IterNo() -1)) + (1/24)) AS EndDTTMAutoGenerate 24 WHILE NUM($(vMinDate) + IterNo() -1) <= Num($(vMaxDate)) + 3/96 ;

IslandCalendar:load
    
StartDTTM
     ,
EndDTTM
     ,
MONTH(FLOOR(StartDTTM)) AS StartMonth
     ,
YEAR(FLOOR(StartDTTM)) AS StartYear
     ,
DATE(FLOOR(StartDTTM)) AS StartDt
     ,
TIME(FRAC(StartDTTM)) AS StartTime
     ,
TIME(FRAC(EndDTTM)) AS EndTimeRESIDENT TempCalendar
;
DROP TABLE TempCalendar;

This is the expression I am using in the chart.

 

=

SUM(if(DTTM_PAT_ARR <= EndDTTM AND DTTM_PAT_ROOMED >= EndDTTM,COUNTER_CSN

))

Thanks for any help.

0 Replies