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

Limit load date with Date

Hi Friends

I want to load data in my qv document limiting the with cut off date

I have below script in my data load script

let bDate=num(date(makedate(2021,06,30)));


ctype,
$(vDate)-date as NOD
FROM
$(vPath)LTHSALES.qvd
(qvd)
where num(date)>$(bDate)

 

but it does not work properly. 

Kindly help me to solve it please

 

 

1 Solution

Accepted Solutions
Vegar
MVP
MVP

Date hamdling can be tricky sometimes. The first thing I would check if my default date format is the same as the format of my source. If not, them it you might get in trouble using num(date).

Try this expression  to see what you get.

ctype,
$(vDate) as vDate,

$(bDate) as bDate 

date, 

num(date) as date_num
FROM
$(vPath)LTHSALES.qvd (qvd)
//where num(date)>$(bDate)

;

Are all your date fields recognised as dates/numerics?

View solution in original post

2 Replies
Vegar
MVP
MVP

Date hamdling can be tricky sometimes. The first thing I would check if my default date format is the same as the format of my source. If not, them it you might get in trouble using num(date).

Try this expression  to see what you get.

ctype,
$(vDate) as vDate,

$(bDate) as bDate 

date, 

num(date) as date_num
FROM
$(vPath)LTHSALES.qvd (qvd)
//where num(date)>$(bDate)

;

Are all your date fields recognised as dates/numerics?

Akeem
Contributor
Contributor

@MyAARPMedicare wrote:

Hi Friends

I want to load data in my qv document limiting the with cut off date

I have below script in my data load script

let bDate=num(date(makedate(2021,06,30)));


ctype,
$(vDate)-date as NOD
FROM
$(vPath)LTHSALES.qvd
(qvd)
where num(date)>$(bDate)

 

but it does not work properly. 

Kindly help me to solve it please

 

 


Is there a way to limit the records imported based on date to save time/space? Our system has 20 years of data and if we only want to import the last 5 or 10 years. Is this possible?