Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Qlik experts,
I'm unable to get the date fields for Date Picker Widget. I am able to see them in fields but not in date picket as an option.
Here is the script:
Dates:
LOAD
max(Date_Created) as MaxDate,
min(Date_Created) as MinDate
Resident Data;
LET vMaxDate = Peek('MaxDate',0,'Dates');
LET vMinDate = Peek('MinDate',0,'Dates');
DROP Table Dates;
[Cal]:
DECLARE FIELD DEFINITION Tagged ('$date')
FIELDS
Dual(Year($1), YearStart($1)) AS [Year] Tagged ('$axis', '$year'),
Dual('Q'&Num(Ceil(Num(Month($1))/3)),Num(Ceil(NUM(Month($1))/3),00)) AS [Quarter] Tagged ('$quarter', '$cyclic'),
Dual(Year($1)&'-Q'&Num(Ceil(Num(Month($1))/3)),QuarterStart($1)) AS [YearQuarter] Tagged ('$yearquarter', '$qualified'),
Dual('Q'&Num(Ceil(Num(Month($1))/3)),QuarterStart($1)) AS [_YearQuarter] Tagged ('$yearquarter', '$hidden', '$simplified'),
Month($1) AS [Month] Tagged ('$month', '$cyclic'),
Dual(Year($1)&'-'&Month($1), monthstart($1)) AS [YearMonth] Tagged ('$axis', '$yearmonth', '$qualified'),
Dual(Year($1)&'-'&Week($1), Week($1)) AS [YearWeek] Tagged ('$axis', '$yearweek', '$qualified'),
Dual(Month($1), monthstart($1)) AS [_YearMonth] Tagged ('$axis', '$yearmonth', '$simplified', '$hidden'),
Dual('W'&Num(Week($1),00), Num(Week($1),00)) AS [Week] Tagged ('$weeknumber', '$cyclic'),
Date(Floor($1)) AS [Date] Tagged ('$axis', '$date', '$qualified'),
Date(Floor($1), 'D') AS [_Date] Tagged ('$axis', '$date', '$hidden', '$simplified'),
If (DayNumberOfYear($1) <= DayNumberOfYear($(vMaxDate)), 1, 0) AS [InYTD] ,
Year($(vMaxDate))-Year($1) AS [YearsAgo] ,
If (DayNumberOfQuarter($1) <= DayNumberOfQuarter($(vMaxDate)),1,0) AS [InQTD] ,
4*Year($(vMaxDate))+Ceil(Month($(vMaxDate))/3)-4*Year($1)-Ceil(Month($1)/3) AS [QuartersAgo] ,
Ceil(Month($(vMaxDate))/3)-Ceil(Month($1)/3) AS [QuarterRelNo] ,
If(Day($1)<=Day($(vMaxDate)),1,0) AS [InMTD] ,
12*Year($(vMaxDate))+Month($(vMaxDate))-12*Year($1)-Month($1) AS [MonthsAgo] ,
Month($(vMaxDate))-Month($1) AS [MonthRelNo] ,
If(WeekDay($1)<=WeekDay($(vMaxDate)),1,0) AS [InWTD] ,
(WeekStart($(vMaxDate))-WeekStart($1))/7 AS [WeeksAgo] ,
Week($(vMaxDate))-Week($1) AS [WeekRelNo] ;
DERIVE FIELDS FROM FIELDS [Date_Created] USING [Cal] ;
//exit Script;
Date field form the table:
The data picker will only show fields that are tagged with $date. Try adding this to the end of your script.
Tag Field Date_Created With '$date';
-Rob
The data picker will only show fields that are tagged with $date. Try adding this to the end of your script.
Tag Field Date_Created With '$date';
-Rob
Thanks for the help @rwunderlich 🙂