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: 
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 (3)
11 Replies
kushalthakral
Creator III
Creator III

Hi 

 

Is it possible for you to share sample qvw file it is very hard to look for the solution 

 

Thanks

Kushal

sunny_talwar

Something is not adding up here... if this is the script you are using... then the first row should never happen

image.png

Because when the DataType = 'Entry', then Date and entrydate should match, but in your case, Date is matching rewarddate.... can you double/triple check your script to make sure that it is what you have shared?

neena123
Partner - Creator
Partner - Creator
Author

No that is my script. Could it be because the both dates are from the same table?
sunny_talwar

As far as I understand Qlik, it can't unless you have found a way to break the logic :). Jokes apart, may be share the logfile.

neena123
Partner - Creator
Partner - Creator
Author

Is this enough data? I shared some of the report not everything but it has enough data to work with the master calendar. Let me know if it isn't enough. Thanks! 

sunny_talwar

The shared dashboard have no data at all.. Can you share PBDRapidTEST.xlsx?

neena123
Partner - Creator
Partner - Creator
Author

Sorry! Don't know what happened there!

sunny_talwar

I think your key (estimatenumber) alone is not good enough... I added arsalesname to the key and it looks better.... but you might need to add more fields to make the connection unique between your data and datelink table

sunny_talwar

Sorry, I forgot to attach the dashboard