Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
neena123
Partner - Creator
Partner - Creator

What is going on with my Master Calendar? Incorrect Dates

Hello!

 I have posted a couple questions that are centered around my dates in my expressions. I now realize I think my master calendar is messed up. I have two dates that I have linked together and created a master calendar please see below:

Calendar.PNG

 

I noticed when I went to select month of Jan to see how many BIDS and JOBS were in the month of Jan I noticed the Date field is all messed up.  How do I fix this? 

Table.PNG

Here is my Calendar Script 

DateLink:
LOAD Distinct
estimatenumber,
Date(entrydate,'DD-MM-YYYY') as Date,
'Entry' as DateType
Resident Estimate
//WHERE rewarddate <> null()
;
Concatenate(DateLink)
LOAD Distinct
estimatenumber,
Date(rewarddate,'DD-MM-YYYY') as Date,
'Reward' as DateType
Resident Estimate
Where rewarddate <> null()
;

Minmaxdates:
LOAD
min([Date]) as mindate,
max([Date]) as maxdate
Resident [DateLink];

Let vMinDate = Num(Peek('mindate',0,'minmaxdates'));
Let vMaxDate = Num(Peek('maxdate',0,'minmaxdates'));

DROP table Minmaxdates;

DateRanges:
LOAD
$(vMinDate) + IterNo()-1 as dateNum,
Date($(vMinDate) + IterNo()-1) as Date
AutoGenerate 1 While $(vMinDate) + IterNo()-1 <= $(vMaxDate);

MasterCalendar:
LOAD
Date as [Date],
Day(Date) as Day,
Week(Date) as Week,
Month(Date) as Month,
'Q' & Ceil(Month(Date)/3) as Quarter,
Year(Date) as Year
Resident DateRanges Order by Date asc;

DROP Tables DateRanges;

 

Thanks!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Labels (2)
11 Replies
neena123
Partner - Creator
Partner - Creator
Author

Thanks!!! It looks better! But I am still confused. In this table below I should only be showing BID that happened in January and JOBs in January. Bid are based of the entry date. But there are entrydates that are in December and are showing up after I have selected January. Am I missing something? Table.PNG

sunny_talwar

Like I said, a better key is needed... try this

DateLink:
LOAD arsalesname,
estimatenumber,
rewarddate,
entrydate,
Date(rewarddate,'DD-MM-YYYY') as Date,
'Reward' as DateType
Resident Estimate
Where rewarddate <> '-';

Concatenate(DateLink)
LOAD arsalesname,
estimatenumber,
rewarddate,
entrydate,
Date(entrydate,'DD-MM-YYYY') as Date,
'Entry' as DateType
Resident Estimate
Where entrydate <> '-';