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: 
arsallee3
Contributor III
Contributor III

Master Calendar issue

Good day, working on some new development and having problem understanding why Master Calendar is not working.

Original field load is date time stamp, loading this as is along with additionally load date and time only.

Creating master calendar to the date only load and this creates fine and links fine however when I select this date out of the master calendar I get no results on simple sum of quantity.

sample data of qvf attached.

I appreciate any assistance.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Your TicketDateNum is a Timestamp, with date and time part.

If you then create your master calendar, most of the timestamps won't match with your calendar values.

2016-04-20 20_09_06-Qlik Sense Desktop.png

Take care to create a Datefield with only date part:

[TicketTable]:

LOAD [TicketId],

  [HaulerId],

    [TicketDate],

  [TicketDateTime],

  Floor([TicketDateNum]) as [TickerDateNum],

  [WaterTypeId],

  [OperatorId],

  [Quantity],

  [DisposalId],

  [TicketNo],

  [DeliveryType]

FROM [lib://FolderQVD (bosque_asallee)/TicketTable.QVD] 

(qvd) Where TicketDateNum >= '$(vMonthStart)' and TicketDate < '$(vToday)';

Also check your other date fields if they have a numeric representation as requested (i.e. integer values for date fields, floating point for timestamps / time values).

Why don’t my dates work?

View solution in original post

4 Replies
swuehl
MVP
MVP

Your TicketDateNum is a Timestamp, with date and time part.

If you then create your master calendar, most of the timestamps won't match with your calendar values.

2016-04-20 20_09_06-Qlik Sense Desktop.png

Take care to create a Datefield with only date part:

[TicketTable]:

LOAD [TicketId],

  [HaulerId],

    [TicketDate],

  [TicketDateTime],

  Floor([TicketDateNum]) as [TickerDateNum],

  [WaterTypeId],

  [OperatorId],

  [Quantity],

  [DisposalId],

  [TicketNo],

  [DeliveryType]

FROM [lib://FolderQVD (bosque_asallee)/TicketTable.QVD] 

(qvd) Where TicketDateNum >= '$(vMonthStart)' and TicketDate < '$(vToday)';

Also check your other date fields if they have a numeric representation as requested (i.e. integer values for date fields, floating point for timestamps / time values).

Why don’t my dates work?

arsallee3
Contributor III
Contributor III
Author

Hmm that is strange, here is how I am loading the QVD directly from the database, do I need to convert to date when I run the load from this QVD file also you think?

TicketTable:

LOAD TicketId,

    HaulerId,

    TicketDate, (original date time field)

    Time(TicketDate) as TicketDateTime,

    Date(TicketDate) as TicketDateNum,

    WaterTypeId,

    OperatorId,

    Quantity,

    DisposalId,

    TicketNo,

    DeliveryType;

SQL SELECT TicketId,

    HaulerId,

    TicketDate,

    WaterTypeId,

    OperatorId,

    Quantity,

    DisposalId,

    TicketNo,

    DeliveryType

FROM SWD.dbo.Ticket ;

STORE TicketTable INTO [lib://FolderQVD (bosque_asallee)/TicketTable.QVD] (qvd);

Drop Table TicketTable;

swuehl
MVP
MVP

Yes, Date() and Time() are just formatting functions and do not change the underlying value.

To only get date / time part:

LOAD TicketId,

    HaulerId,

    TicketDate, (original date time field)

    Time(Frac(TicketDate)) as TicketDateTime,

    Date(Floor(TicketDate)) as TicketDateNum,

    WaterTypeId,

    OperatorId,

    Quantity,

    DisposalId,

    TicketNo,

    DeliveryType;

arsallee3
Contributor III
Contributor III
Author

Got it, that solves all my issues!