Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Period date selecting!!!

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

1 Solution

Accepted Solutions
Peter_Cammaert
Partner - Champion III
Partner - Champion III

4 Replies
Not applicable
Author

Help !!

Peter_Cammaert
Partner - Champion III
Partner - Champion III

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

Not applicable
Author

Hi Peter Cammaert,

Can you Please provide me a sample for this explanation.

Thanks

John

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Here you go.