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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calender Object is not working properly when we are dealing with time

Hi  I have scenario,

I have calendar object and my records are with time like below

2014/12/25 8:00
2014/12/25 11:00

I have created calendar object and with few years data.

Issue is if i select start date and end date it is not taking end date records becuase

end date is showing here is 2016/12/29  12:00:00 AM which is taking 2016/12/28 12:00:00 PM.

Please provide me the solution when we are dealing the calendar object with time scenarios.

Here if we select end date as 2016/12/30   then 2016/12/30  records will come other wise  it won' come.

Actua;

If we select enddate as  2016/12/29 then 2016/12/30 records need be prsenet.

Please check, end date and do the needful

Regards

Thiru

1 Solution

Accepted Solutions
settu_periasamy
Master III
Master III

Hi,

May be try with DayStart() and DayEnd() function.

if(isnull(GetFieldSelections(Starttime))=0 and isnull(GetFieldSelections(Endtime))=0,
Count({<YearMonth={">=$(=Date(DayStart(Vstartdate), 'YYYY/MM/DD h:mm:ss TT'))<=$(=Date(DayEnd(Venddate), 'YYYY/MM/DD h:mm:ss TT'))"},
Time = {"=(Frac(Time) + 1/86400) >= Time#(Starttime, 'h:mm TT') and (Frac(Time) - 1/86400) <= Time#(Endtime, 'h:mm TT')"}>} Country),
Count({<YearMonth={">=$(=Date(DayStart(Vstartdate), 'YYYY/MM/DD h:mm:ss TT'))<=$(=Date(DayEnd(Venddate), 'YYYY/MM/DD h:mm:ss TT'))"}>} Country))

View solution in original post

1 Reply
settu_periasamy
Master III
Master III

Hi,

May be try with DayStart() and DayEnd() function.

if(isnull(GetFieldSelections(Starttime))=0 and isnull(GetFieldSelections(Endtime))=0,
Count({<YearMonth={">=$(=Date(DayStart(Vstartdate), 'YYYY/MM/DD h:mm:ss TT'))<=$(=Date(DayEnd(Venddate), 'YYYY/MM/DD h:mm:ss TT'))"},
Time = {"=(Frac(Time) + 1/86400) >= Time#(Starttime, 'h:mm TT') and (Frac(Time) - 1/86400) <= Time#(Endtime, 'h:mm TT')"}>} Country),
Count({<YearMonth={">=$(=Date(DayStart(Vstartdate), 'YYYY/MM/DD h:mm:ss TT'))<=$(=Date(DayEnd(Venddate), 'YYYY/MM/DD h:mm:ss TT'))"}>} Country))