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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
bhavvibudagam
Creator II
Creator II

Restrict the date field

Hi,

I have a date field i.e ACCIDENT_DATE.In the date field i have the data from 2001 to 2016.

My requirement is when i click on 2006 then it has to be displayed back 5 years i.e from 2001 to 2006.

It has to be done in Dynamically in Script only.Please help me to do.If possible please attach the sample qvw file.

1 Solution

Accepted Solutions
Digvijay_Singh

Check this example, just removed 'Year=' from what Kushal has suggested

View solution in original post

6 Replies
bindu_apte
Creator III
Creator III

Hi,

Hope this thread will help.

Dynamic Ytd from selection

Not applicable

Hi Bhavvi,

try like below

ACCIDENT_DATE=<=$(max(ACCIDENT_DATE))


in your expression.


Regards

Tripati

Kushal_Chawda

try below expression

=Sum({<Year = {">=$(=max(Year)-5)<=$(=max(Year))"}, Year=>}Amount)

Digvijay_Singh

Check this example, just removed 'Year=' from what Kushal has suggested

Digvijay_Singh

Also not sure why you would want this to be done in script, you may need to you asoftable concept along with flag creation to identify 5 years window in the front end.

bhavvibudagam
Creator II
Creator II
Author

Thank you so much Digvijay for the above attachment file. Can you please upload the Sample Qvw file with flag creation.