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: 
viveksingh
Creator III
Creator III

Load QVDs between two dates

Hi All, 

I Have Multiple QVDs with similar names like SALES_1,SALES_2, SALES_3, SALES_4, SALES_5, SALES_6.....

I have to load only those QVDs that have a specific date range in between 20200101 and 20200520.

I tried below, but not working. 

Let Vstart=Num(20200101 );

Let Vend=Num(20200520);

Sales:

Load *

from SALES*.qvd

where Num(Date) between $(Vstart) and $(Vend);

 

Labels (1)
4 Replies
sunny_talwar

Try this for Vstart and Vend

LET Vstart = Num(MakeDate(2020, 1, 1));
LET Vend = Num(MakeDate(2020, 5, 20));
Vegar
MVP
MVP

Between is not a Qlik function you could use < and > instead.

LOAD *
FROM SALES*.qvd
WHERE Date >= $(Vstart) AND Date <= $(Vend)

You do also need to make sure that you are comparing the correct values. If your Date field is a date then you will probably need to  do something like @sunny_talwar  is suggesting above. 

For reference, remember that

If today() = '20200922' then num(Today()) = 44096.  This because 20200922 is only the text representation of the date not the numeric value of the date. 

Kushal_Chawda

@viveksingh  If your actual field value in data also holds the values like YYYYMMDD format then try below

Let Vstart=floor(date#(20200101,'YYYYMMDD'));

Let Vend=floor(date#(20200520,'YYYYMMDD'));

then try below where

Sales:

Load *

from SALES*.qvd

where floor(date#(Date,'YYYYMMDD'))  >= $(Vstart) and floor(date#(Date,'YYYYMMDD'))  <=$(Vend);

Brett_Bleess
Former Employee
Former Employee

@viveksingh  You have some good responses here, we would greatly appreciate it if you could circle b...

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.