Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a date field for current year 2015 in data base , however i developed a master calendar for current year,
my master calender has 26 periods with 14 days in each period. now i want period for my date field that will come from data base.
[database date field having records only for today, now i want to know on which period my today's date will fall. ]
then i want to show this period start date and end date in a text object.
can any one help me on this.
Regards,
John
Here you go.
Help !!
The simplest method (but it may put some pressure on the Qlik UI) is to perform calculations on-the-fly. If your periods start on the 1st of january, then the period number is:
=1 + (DayStart(DatabaseDate) - YearStart(DatabaseDate))/14
If you call the previous expression vPeriodNo, then the start and end dates of that period become
=YearStart(DatabaseDate) + (vPeriodNo-1) * 14
=DayEnd(YearStart(DatabaseDate) + vPeriodNo*14 - 1)
[Edit] Minor correction to set Period End Date to a time value of 23:59:59
Hi Peter Cammaert,
Can you Please provide me a sample for this explanation.
Thanks
John
Here you go.