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

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
Karpenter1
Contributor
Contributor

Can datepicker on calendar object choose closest valid date?

Hi, using the calendar object for the first time and it seems to be working well with the exception of the date picker. If I select a date on the date picker that doesn't have any orders, there is no selection. Is there a way I can modify this behaviour so that the closest valid date is selected?

 
Labels (1)
1 Reply
Ksrinivasan
Specialist
Specialist

hi,

for your understanding

 

DailySales:  // actual my data
LOAD
SalesDate,
SalesVolumn
FROM [lib://REPORT EXTRACTION /WIP_Report/Excel and Master Data/Concordinate.xlsx]
(ooxml, embedded labels, table is Dailysales);

CalendarMaster:   // calendar object join with actual my data (SalesDate) field. you can also replace SalesDate to your data field name.
Load
Date(SalesDate) as SalesDate,
Year(SalesDate) as Year,
'Q' & Ceil(Month(SalesDate) / 3) as Quarter,
Month(SalesDate) as Month,
Day(SalesDate) as Day,
Week(SalesDate) as Week;

Load
Date(MinDate + IterNo()-1) as SalesDate
While(MinDate + IterNo()-1) <=Num(MaxDate);

Load
Min(Date(Date#(SalesDate,'M/D/YYYY'))) as MinDate,
Max(Date(Date#(SalesDate,'M/D/YYYY'))) as MaxDate
Resident DailySales;

 

ksrinivasan.