Just noticed your question was not answered. Could you confirm that by dynamic date filters, you are referring to filters such as today, this month, previous 90 days, etc.? Would these filters be defined once only by the report author or do you need a way for report consumers to change them in a filter control on the report?
I am looking for the same option -- my users are not fond of the slider bar/calendar pick-the-date for date filters. They asked for things like today, last week, last 30 days, last 60 days, etc. Are those even possible?
Mere and Ben,
Here is an example of how a filter for the last 30 days using 'VA_Date' as a Datetime category:
TreatAs(_Date_, ( TreatAs(_Number_, 'VA_Date'n) / 86400 )) >= TreatAs(_Date_, ( ( TreatAs(_Number_, Now()) / 86400 ) - 30 ))
Replace the 'VA_Date' value with your category name.
Updating the last numeric value will allow you to base this filter on the filtering criteria 'last 60 days', 'last 90 days', etc.
In the next release of Visual Analytics, you are able to substitute 30 in Shawn's filter expression above with a parameter using the designer. Report consumers can then select the number of days to subtract from now using an on-report control that modifies the parameter's value, such as a slider. As a report author, you can specify a default value, minimum, and maximum for numeric parameters as well in Visual Analytics 7.1.
came across couple of situation where I was asked whether model validation is possible in VA Explorer (for banking, insurance in specific). Is there any thing coming up in near future like integration of SAS RPM with VA in next release?
Thank you Rick, I was able to utilize the formula 'skillman' gave with the hardcoded variance and, separately, the parameter method.
Additionally, I am working on creating a formula that would determine the number of days needed to subtract to get the current time frame and specific previous time frame aggregates (example, current month and all of previous month).
That way one would not have to change the parameter to alter the number of days being subtracted.
I use the code below to extract teh value for last 30 days, but when I use this in calculated Item, It gives me an error message stating: Type mismatch:expected typr at this location is Datetime, type of item being applied is Boolean.
Please let me know if I am doing something wrong. For my report I need to have filter/button that extracts the data for last 30 days from the entire dataset.
Thanks I am able to use this filter now.
However I have one more question. How to use the code above for the date format like "1January 2016". I am able to use for datetime , but not able to do it with the above format.
please confirm that 1januari2016 is a text and not a format for your date.
if this is a text, shurely there must be a way to transform it into a real date.
if it is a date, then it should work like mentioned above.
if it is a text, I will try to find a way to translate it within SAS VA to a real date.
Best would be to have a the date already before importing the data into SAS VA.
There is a video library which can be accessed from within VA version 6.3. In the help drop down you will see a link for videos which will take you to the support.sas.com site:
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.