I have a data type "v_content" with fields "from" and "untill", both are of type DATE(ISO).
Now I need to configure a view, which will show only those v_contents in date range:
show only if from <= NOW <= untill
Sadly, in Filter criteria in view configuration, I can select the field, but cannot compare the value with current date, there are some predefined other non related settings.
Also in Contextual filters, there is no comparsion settings.
So, how do I filter nodes in view by comparsion of its field values against current date?
Thanks in advance.
When you configure condition for date field you you have select showing default value "select a date" which you can change to "Enter a relative date" and then in input field bellow enter "now".
Related
I want to restrict future date selection in AEM adaptive forms.
Also if there is any way to restrict date selection unto any particular date (any future or past date)
You can configure the Minimum Value and the Maximum Value for the date field to prevent the user from selecting a date which is outside this range. However, there are certain restrictions
The values mentioned above cannot be dynamic and would be a fixed value. Hence, you cannot set them to something like today or now. It has to be a value in the ISO format which is yyyy-mm-dd.
As long as you have not specified a display pattern (i.e., you are using the default value of the field), it would bring up the browser's native date picker which disables the dates outside your minimum and maximum range. However, if you set a display format, then AEM's datepicker would be displayed and it doesn't disabled dates outside the min-max specified.
That being said, you can still write a validation rule which throws an error if the value selected/entered is outside the valid date range or if it is greater than today (depending on what you want to validate).
Open the rule editor.
Click on Create rule.
Select Validate by clicking on the dropdown arrow beside the When (which is the default)
In the Using Expression section, select your date field for the First Object, select is before for the operator and select Function Output > Get Current Date for the second object.
The final rule should look as shown below
I have a crystal report where i have a date parameter called range that i want to default the min and maxdate values. So in the edit parameter dialog under value options section there are options for "start" and "end" which i want to be mindate and maxdate respectively. The problem i am trying to solve is i want all records to return if the user does not enter a value for the range. Is this even possible? Thanks in advance for any advice.
I am running latest version of crystal reports
Easy way I think is of using 2 parameters instead of one, That is one parameter for start date and other for End Date.
Add a default value None for both and if user doesn't want to select any value then ask to select None
Now change your record selection formula as
if {?start date} = "None" and {?End date} = "None"
then
//Don't pass any date filter
else
//Add date filter as per parameter selection
An easy way could be to just enter min and max dates manually and make the parameter not optional.
A more elegant way is to check whether the parameter has a value and only filter your records if it has. Put something like the below in your record selection formula:
if hasvalue({?range}) then {yourdatefield} in {?range} else true
If the parameter range has a value then it is used as filter. If it hasn't a value the term will evaluate to true meaning no records will be filtered.
Yes it is possible make the parameter as optional. By default it will bring all the data, if user not select any thing.
I am trying to set up a filter or parameter for different date ranges in Tableau, such as:
Previous Week
Previous 4-Weeks
Previous 8-Weeks
based on the most recent data in the database. Is this possible?
Edit:
I should have been more clear here.
Is it possible to only have these options in the filter and have it based on the maximum date in the database?
Update
Based on your comment and updated question, you can do it as you intend, though it isn't as straight-forward.
NOTE: I did this very quickly and with a random data set, so it will be important for you to test this thoroughly with your data set.
Steps:
Create a parameter control that the users will use to change the selected date range. I created this as a list of strings with values that I can use directly in a calculated (after simple casting):
Create a calculated field that you will use as a filter that references the selection of the parameter control. It tests to see if the difference (in weeks) between the maximum date in the view and the date of any given row is less than the value of the parameter.
Calculation: INT([Date Filter Parameter]) > DATEDIFF("week",ATTR([Date Field]),WINDOW_MAX(MAX([Date Field])))
Place the calculated field in the filter box and set it to True.
You will be able to filter your data like so:
Original Answer
Yup - that is built into Tableau.
Add your date to the filter and select the "Relative Date" option:
You can set the defaults - users can change these later:
Then just "Show Filter":
First of all, i would like to find an existing value in my SQL View table,
see this input:
https://flic.kr/p/xwhRdx
When i input Begin Date and end Date , i want those input to search another field in my SQL view table, that is Form Receive Date.
Example: i have 2 rows with Form Receive Date 17-Sep-2015 and 20-Sep-2015.
When i input Begin Date: 18-Sep-2015 and End Date: 25 Sep-2015, it will search Form Receive date between 18-Sep-2015 and 25-Sep-2015 and will find a row with 20-Sep-2015 as it Form Receive Date.
Is it possible to modify that search function ? Because when i modify the query view and add where FormReceiveDate between BeginDate and EndDate, it search in my SQL table record and it will find nothing because my BeginDate and EndDate is null.
thx before :D
If the column you want to search on is in the same search record, then just designate the Form Receive Date column as a Search Key in the search record field properties. This will add another search field called Form Receive Date to the search page, but will still keep the start date and end date fields, if you want to get rid of those then uncheck those fields as Search Keys in the field properties.
I have a content type called Event which has a field called field_event_date. The date field can have recurring dates. I'm trying to display a list of events and only show each event one time, however it is showing once for each of the recurring dates.
I've found many posts about this and still can't figure it out.
My view is very simple. It is showing fields and I've tried grouping them by title or nid, but neither changes the number of results. I've also tried checking Distinct (and Pure Distinct) under Query Settings. But nothing changes the number of results returned.
Please let me know if you have any suggestions.
You just need to use under field configuration the "Start date only" and "Show 1 value" as seen in the screenshot below. No need for aggregation and distinct settings.
Apply a filter on the date field
Select the operator: 'Is equal to', and type '0'
When you have a multiple value field, the field has a list or array of values. delta=0 is the first value
https://www.drupal.org/node/1872262#comment-6869736