Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

setting date range in the app qvd layer

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

5 Replies
MK_QSL
MVP
MVP

You mean to say Data should start from 01/01/2017 to 06/04/2020? (i.e. Today 06/04/2017)

Not applicable
Author

Hello Manish,

The data should start from Jan 2007 to april 2020(3 years ahead of present date).

Regards,

Jaya

ahaahaaha
Partner - Master
Partner - Master

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

saimahasan
Partner - Creator III
Partner - Creator III

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);

Anil_Babu_Samineni

Then set analysis may be this. Make sure, The DateField and Today format should same


Sum({<DateField = {">=$(=YearStart(Today())) <= $(=AddYears(DateField, 3))"}>}Sales)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful