Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hey Guys
Im sure you can help me quite quickly on this…
I like to exclude values from the loading process of a data model.
Now I could use just this formula in the loading script from these 2 tables and it would work for now…
Dim_Calendar_Process:
NoConcatenate LOAD
%Date as %DateProcess,
x
x
x
FROM
$(dirQVD)_Generic\Dim_Calendar.qvd
(qvd)
Where %DateProcess >= ('numeric Value of the date');
My question Is whats the syntax for today in QV?
Where %DateProcess >= (today – 1000 (days))
Many thansk
Where %DateProcess >= num(today()–1000) to go back 1000 days
or Where %DateProcess > num(AddYears(today(),–3)) to get the last 3 years.
today()
Try like: Where %DateProcess >= (today() – 1000)
Try this:
Where Num(%DateProcess) >= Num(AddYears(Today(), -3));
Where %DateProcess >= num(today()–1000) to go back 1000 days
or Where %DateProcess > num(AddYears(today(),–3)) to get the last 3 years.
One more way
// Create a dates for last 3 years from today
Dates:
LOAD date(addyears(Today(),-3)+IterNo()-1,'DD-MM-YYYY') as Date_Check
AutoGenerate(1)
While addyears(Today(),-3)+IterNo()-1 <= Today();
Dim_Calendar_Process:
NoConcatenate LOAD
%Date as %DateProcess,
x
x
x
FROM
$(dirQVD)_Generic\Dim_Calendar.qvd
(qvd)
Where exists (Date_Check,%DateProcess);
drop table Dates;
Note - Make sure format of the Date_Check & %DateProcess should be same
i believe i have to use %Date instead of %DateProcess
%Date as %DateProcess
tried both solutions by using %Date and %DateProcess
both version are working fine by using %Date
Many thanks