Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dates in QV


Hi,

I have the following:

LOAD

BusinessDate,

AccountCode,

TT2,

Nominal,

StartDate,

EndDate

FROM

  $(qvdPath)$(ReportQVD).qvd (qvd)

WHERE wildmatch(AccountCode,'test0?','novat?','novt??') = 0

and   num(date#(BusinessDate,'YYYYMMDD')) >= num(Date#($(vCutOffDate),'YYYYMMDD'))

How can I know that a field is really a date field so I don't need to convert to a number. What's the best way to compare 2 date fields if having suspicions that one is  a string with a date stored inside. Any comments how to compare 2 fields which could be strings so the date comparison could be totally wrong? I am also worried that expressions like the above can cause performance issues so need the most efficient way if any?

Thanks.

4 Replies
MK_QSL
MVP
MVP

hic
Former Employee
Former Employee

If the date has been interpreted correctly, it will be right-aligned in a list box. Then it will be a number, and the Num() function is not necessary.

See

Why don’t my dates work?

Data Types in QlikView

HIC

PrashantSangle

Hi,

See Alt() in help menu might be helpful to you.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Peter_Cammaert
Partner - Champion III
Partner - Champion III

There are a lot of questions in your post, which makes it difficult to provide a clear answer...

The more your field values prove to be inconsistent, the higher the price you'll pay for handling all different cases in QV script. If you can be sure that all values are formatted exactly the same, you can safely rely on date#() on condition that you specify a correct format string.

For every call to date# that is offered a correctly formatted date, the numerical value will be part of the output.

For every call to date# that is offered an incorrectly formatted date, the numerical value will be missing in the output. In theory, IsNum(date#(...)) should now return false().