Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
Not applicable

Deriving Calendars From Multiple Date Fields

I am trying to create a calendar with the same fields from three different date fields. 

[MasterCalendar]:

  DECLARE FIELD DEFINITION Tagged ('$date')

Fields

Dual(Year($1), YearStart($1)) as [Year] Tagged ('$axis', '$year') ,

    Dual(Year($1)&'-'&Month($1), monthstart($1)) AS [YearMonth] Tagged ('$axis', '$yearmonth', '$qualified'),

    Month($1) AS [Month] Tagged ('$month', '$cyclic'),

    Date(Floor($1)) AS [Date] Tagged ('$axis', '$date', '$qualified'),

    Time($1) AS [Time],

    Time($1,'hh TT') AS [Hour];  

DERIVE FIELDS FROM FIELDS %CALLDATETIME, %EVENTDATETIME, %LOGINDATETIME USING [MasterCalendar] ;

This only creates the calendar for %CALLDATETIME.

I also tried using 3 separate calendars deriving from one field each, and that does not work either. 

Any ideas why this won't work?

3 Replies
MVP
MVP

Re: Deriving Calendars From Multiple Date Fields

Your code works 100% unmodified for me when I test it in Qlik Sense 2017 June release. Are you absolutely sure that both the fields %EVENTDATETIME and %LOGINDATETIME are really date fields?

Not applicable

Re: Deriving Calendars From Multiple Date Fields

I'm defining the three fields as follows, prior to trying to create the calendar.

Timestamp(Timestamp#(event_datetime,'YYYY-MM-DD hh:mm:ss')) as %EVENTDATETIME

Timestamp(Timestamp#(logindatetime,'YYYY-MM-DD hh:mm:ss')) as %LOGINDATETIME

Timestamp(Timestamp#(calldatetime,'YYYY-MM-DD hh:mm:ss')) as %CALLDATETIME

MVP
MVP

Re: Deriving Calendars From Multiple Date Fields

Do you have some rows of data with the dates that you could supply as an LOAD * INLINE .... I still get things to work in my end ....