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: 
Anonymous
Not applicable

Master calendar and Fact table dates

Hello

Can somebody help me with the below query regarding Master Calendar?

I tried using the below script to generate a master calendar. I am not sure what's going wrong with it. May be I am missing out something

I need to display tickets raised between a certain time period i.e between start and end dates.

I also need to display zero values for dates where there were no tickets raised

So i made changes to the script like below but when I plot the graph I dont get to see the blank values for those weeks where there were no tickets raised.

 

QuartersMap:

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

Temp:
Load
min([Release Start Date]) as minDate,
max([Release End Date]) as maxDate
Resident Release_dates;

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 [Ticket Raised Time (GMT)],

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;

15 Replies
kuczynska
Creator III
Creator III

I think I was facing similar issue at some point. I tried to change the expression in the bar chart as follows:

count(#Tickets) + 0.001

and changing the value type in the Number tab to something with a smaller resolution - integer for example (I found that solution somewhere in Qlik Community). It worked for me and additional bars with value 0 were displayed on my bar chart. Maybe that will help.

Anonymous
Not applicable
Author

I tried that but its not working.I dont know whats going wrong as the script seems fine to me.

Anonymous
Not applicable
Author

I have pasted the script above.
Let me know what else you need.

Anonymous
Not applicable
Author

Release_dates:
LOAD Release as  Release#,
Environment,
        New_Environment,
[Release Start Date]

FROM
[Release Dates].xls

Tickets:

LOAD
     Release#,

     Status,
     Duration,
     [Impacted Tools],
     Severity,
     [Ticket Raised Time (GMT)],
     [Ticket Resolved Time (GMT)],
     [Raised By],
         Created,
     [Issue ID],
              if(Status = 'Closed',
      if(Duration > 0 and  [Ticket Raised Time (GMT)]>'' and  [Ticket Response Time (GMT)]>'' ,
      if(Severity = '1' and ([Ticket Response Time (GMT)] - [Ticket Raised Time (GMT)])*24 <=1 , 'SLA_MET',
   if(Severity = '2' and ([Ticket Response Time (GMT)] - [Ticket Raised Time (GMT)])*24 <=1,'SLA_MET',
   if(Severity = '3' and ([Ticket Response Time (GMT)] - [Ticket Raised Time (GMT)])*24 <=2, 'SLA_MET','SLA_NOT_MET'))))) as SLA_Indicator,
  
     ,
     [Root Cause],
    
     [Ticket Response Time (GMT)],
     [Ticket Closed Time (GMT)],
    
     ID,
      SubField(Environment,';') as Environment,
    
,
      if([Root Cause] like '*App*', 'App',
     if([Root Cause] like '*Env*','Env')) as Root_Cause
    
FROM
Ticket.xls
)) ;

This is my script

My Dimension for the chart is

 

=

if(weekstart([Ticket Raised Time (GMT)])>=weekstart([Release Start Date]) and WeekStart([Ticket Raised Time (GMT)])<=weekstart([Release End Date]),weekstart([Ticket Raised Time (GMT)]))

My Expression for the chart is

  For App -

sum

({<New_Environment = {"UTE*",'ALL'}, Severity ={1,2}, Status ={'Closed','In Progress','Pending For User Verification'}, Root_Cause ={'App'}>}Duration) /118.5

For Env -

 

sum

({$<New_Environment = {"UTE*",'ALL'}, Severity ={1,2}, Status ={'Closed','In Progress','Pending For User Verification'}, Root_Cause ={'Env'}>}Duration) /118.5

Anonymous
Not applicable
Author

Also sharing the dates table for Release dates,xls

ReleaseEnvironmentNew_EnvironmentRelease Start DateRelease End Date
R39UTE1UTE124-Feb-1414-Jun-14
R39#UTE1UTE124-Feb-1414-Jun-14
R40UTE2UTE226-May-1413-Sep-14
R40#UTE2UTE226-May-1413-Sep-14
R41UTE1UTE125-Aug-146-Dec-14
R41#UTE1UTE125-Aug-146-Dec-14
R42UTE2UTE217-Nov-1414-Mar-15
R42#UTE2UTE217-Nov-1414-Mar-15
R43UTE1UTE112-Jan-1513-Jun-15
R43#UTE1UTE112-Jan-1513-Jun-15
R44UTE2UTE220-Apr-1519-Sep-15
R44#UTE2UTE220-Apr-1519-Sep-15
R39ALLALL24-Feb-1414-Jun-14
R40ALLALL26-May-1413-Sep-14
R41ALLALL25-Aug-146-Dec-14
R42ALLALL17-Nov-1414-Mar-15
R43ALLALL12-Jan-1513-Jun-15
R44ALLALL20-Apr-1519-Sep-15
R39IDE1IDE124-Feb-1414-Jun-14
R39IDE1#IDE124-Feb-1414-Jun-14
R40IDE2IDE226-May-1413-Sep-14
R40IDE2#IDE226-May-1413-Sep-14
R41IDE1IDE125-Aug-146-Dec-14
R41#IDE1IDE125-Aug-146-Dec-14
R42IDE2IDE217-Nov-1414-Mar-15
R42#IDE2IDE217-Nov-1414-Mar-15
R43IDE1IDE112-Jan-1513-Jun-15
R43#IDE1IDE112-Jan-1513-Jun-15
R44IDE2IDE220-Apr-1519-Sep-15
R44#IDE2IDE220-Apr-1519-Sep-15
Anonymous
Not applicable
Author

I have tried to cut the timestamp out from the date function and it has worked.