Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I have an urgent query regarding limiting the range wrt to the dates in the QVD layer.
right now i am using
LET vFromDate = Date(MonthStart(AddMonths(Today(),-122)),'YYYY-MM-DD') in the setup sheet
it limits the data from a certain date to the present date in the orders qvd and also in the calendars.
But i need to show the data from 2007 to 3years from the present date.
How do i update the expression?
Please help me.
Thanks & Regards,
Jaya
You mean to say Data should start from 01/01/2017 to 06/04/2020? (i.e. Today 06/04/2017)
Hello Manish,
The data should start from Jan 2007 to april 2020(3 years ahead of present date).
Regards,
Jaya
Hi Jaya,
May be like this
LET vFromDateStart = Date('2007-01-01');
LET vFromDateFinish = Date(MonthStart(AddMonths(Today(),36)),'YYYY-MM-DD'); or
LET vFromDateFinish = Date(AddMonths(Today(),36),'YYYY-MM-DD');
And in code of script
[Field date] >= $(vFromDateStart ) And [Field date] <= $(vFromDateFinish )
Regards,
Andrey
You can use the following expression:
Let vStartDate = monthname('01/01/2007');
Let vEndDate = MonthName(AddYears(Today(),3)) ;
and then limit your data based on these 2 variables.
For eg: load *
from a.qvd
where Date_Monthname>=$(vStartDate) and Date_Monthname<=$(vEndDate);
Then set analysis may be this. Make sure, The DateField and Today format should same
Sum({<DateField = {">=$(=YearStart(Today())) <= $(=AddYears(DateField, 3))"}>}Sales)