Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date field

Hi

I have a field that represents a date in the format 20160401

I need to

1. Change the field so that it is recognised as a date

2. Only include the records where the date is greater than today

2 Replies
sunny_talwar

May be do like this:

LOAD *

Where DateField > Today();

LOAD Date#(DateField, 'YYYYMMDD') as DateField

          OtherFields

FROM Source;

Some blogs on how to read date correctly:

Why don’t my dates work?

Get the Dates Right

swuehl
MVP
MVP

And to avoid the preceding load and to filter the records already at the source:

Let vCutOff = Num(Date(Today(),'YYYYMMDD'));

LOAD Date#(DateField, 'YYYYMMDD') as DateField

          OtherFields

FROM Source

WHERE DateField > $(vCutOff);