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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
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
petter
Partner - Champion III
Partner - Champion III

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
Author

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

petter
Partner - Champion III
Partner - Champion III

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 ....