Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
mhmmd_srf
Creator II
Creator II

From and To Date in Calendar

Hi All,

I have a date field called ShipDate.

I need to implement Calendar Selection From Ship Date and To Ship Date.

But is not working properly.

I am attaching my test file. Could you please check once at your end.

Thanks,

Sarif

2 Replies
dplr-rn
Partner - Master III
Partner - Master III

i didnt see any triggers in the document.

You should create actions on change of the from and to variables to select your date field. See below video for further help

Selecting Arbitrary Date Ranges - YouTube

vishsaggi
Champion III
Champion III

!Try this ? Calender script taken from Rob cookbook. : Better Calendar Scripts | Qlikview Cookbook

FACT_PROOFOFDELIVERY:

LOAD AHPOrderNumber,

     ShipDate,

     Floor(Date(ShipDate,'MM/DD/YYYY')) as ShipDateKey,

     Date(ShipDate,'MM/DD/YYYY') as ShipDate1,

     ShipmentNumber,

     CustomerPONumber,

     ShiptoParty,

     Shipto_ContactName,

     Shipto_Address_1,

     Shipto_State,

     TrackingNumber,

     Carrier,

     ShippingMethod,

     Received_Date,

     SignedbyName

FROM

(qvd);

//Temp:

//Load

//min("ShipDate1") as minDate,

//max("ShipDate1") as maxDate

//Resident FACT_PROOFOFDELIVERY;

//

//Let varMinDate = Date(Peek('minDate', 0, 'Temp'),'MM/DD/YYYY');

//Let varMaxDate = Date(Peek('maxDate', 0, 'Temp'),'MM/DD/YYYY');

MasterCalendar:

Load

TempDate AS ShipDateKey,

week(TempDate) As Week,

Year(TempDate) As Year,

Month(TempDate) As Month,

Day(TempDate) As Day,

'Q' & ceil(month(TempDate) / 3) AS Quarter,

Week(weekstart(TempDate)) & '-' & WeekYear(TempDate) as WeekYear,

WeekDay(TempDate) as WeekDay

;

//=== Generate a temp table of dates ===

LOAD

date(mindate + IterNo()) AS TempDate

,maxdate // Used in InYearToDate() above, but not kept

WHILE mindate + IterNo() <= maxdate;

//=== Get min/max dates from Field ===/

LOAD

min(FieldValue('ShipDateKey', recno()))-1 as mindate,

max(FieldValue('ShipDateKey', recno())) as maxdate

AUTOGENERATE FieldValueCount('ShipDateKey');