Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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);
Try this for Vstart and Vend
LET Vstart = Num(MakeDate(2020, 1, 1));
LET Vend = Num(MakeDate(2020, 5, 20));
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.
@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);
Regards,
Brett