Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
ioannagr
Creator III
Creator III

Master Calendar date fields not recognized in UI

Hello once again,

I really need help with this.

After I created the Master Calendar, in the UI no date fields are recognized as such.

I can't create master calendar measures in the UI or even use the date range picker.

 

Why is it that? Any clue?

 

Thanks,

Ioanna

8 Replies
dplr-rn
Partner - Master III
Partner - Master III

check data model  viewer and select the date field and check the tags in preview.

what are the values there? i am assuming it is not date

share your script to create master calendar too and maybe we can help

ioannagr
Creator III
Creator III
Author

You are right, the tags are numeric and integer .

Also my script is the following:

 

QuartersMap:

MAPPING LOAD

rowno() as Month,

'Q' & Ceil (rowno()/3) as Quarter

AUTOGENERATE (12);

Temp:

Load

min(donationdate) as minDate,

max(donationdate) as maxDate

Resident blooddonor_questionnaire;

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 donationdate,

week(TempDate) As Week,

Year(TempDate) As Year,

Month(TempDate) As Month,

Day(TempDate) As Day,

YeartoDate(TempDate)*-1 as CurYTDFlag,

YeartoDate(TempDate,-1)*-1 as LastYTDFlag,

inyear(TempDate, Monthstart($(varMaxDate)),-1) as RC12,

date(monthstart(TempDate), 'MMM-YYYY') as MonthYear,

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;

dplr-rn
Partner - Master III
Partner - Master III

change this
Date(TempDate,'MM-DD-YYYY') AS donationdate, //(or your desired format)

also would recommend checking below link. makes calendar a little faster
https://qlikviewcookbook.com/2015/05/better-calendar-scripts/
ioannagr
Creator III
Creator III
Author

Nope, still doesn't get recognized as a date field. What should i do?

Maybe change the format of the date in the Main script in the load editor?

 

I'm clueless here 😬

 

 

also, thanks for the link!

dplr-rn
Partner - Master III
Partner - Master III

sorry yes. change everywhere with Date() function

ioannagr
Creator III
Creator III
Author

I'm sorry, I don't get what everywhere means, everywhere I see "TempDate"? 

Also in the linked table? 

Also this one format  in the picture attached for the date and timestamp?

 

 

Ah, thanks, hope  I figure this out 🙂

 

dplr-rn
Partner - Master III
Partner - Master III

Whereever you have donationdate. that should be converted into date format

ioannagr
Creator III
Creator III
Author

Nope, still doesn't work. 😞

But thanks for your help. Seriously appreciated.

 

 

Ioanna