wordpress CF7 filter date quarter validate - calculated-field

I should create a function to validate field "Trimestre".
The second field "Trimestre" calculate automatically a quarter in year with jQuery function.
For example, If I change a date from 06/04/2022 to 01/01/2022 I would like to display an error message on second field "Trimestre", because the value correct value would be one!
Can you help me, please?

Related

Mismatch on the day of week and week name in Pentaho

I am creating a date dimension table using pentaho and im following the tutorial linked https://www.fabguy.de/howto-create-a-date-dimension-with-pdi-kettle.html
but when I preview my data, I found a mismatch between the column day of week and the column week_name : the week_name showed 'Monday' but the day of week showed '2' when the date is 1900-01-01.
The day of week was generated from the calculation 'Day of year of date A' in the calculator, and the week_name was generated from 'create a copy of field A'.
I noticed that the week_name is the correct one, but I really don't understand why the day of week is wrong.
the whole process looks like this:
enter image description here
the calculator named Calculate additional Dates looks like this:
enter image description here
the mismatch looks like this:
enter image description here
I really want to know how to make the day of week become the correct one, if anyone know how to fix it or the reason of it, plz leave a message here!
Thank you very much!!!
By default, Pentaho starts with Sunday (1) if you want to start with Monday try to use the Formula step with the WEEKDAY function instead.
The Formula step has 3 type
Type 1: Sunday is the first day of the week, with value 1; Saturday has value 7
Type 2: Monday is the first day of the week, with value 1; Sunday has value 7
Type 3: Monday is the first day of the week, with value 0; Sunday has value 6
For example, if today is Thursday I will get the following results

Dynamic date parameters in tableau

How to pass dynamic date parameters in tableau for which one parameter is 2022-01-01 and second parameter changes every quarter last day
Firstly, you should create a Calculation Field that represents END QUARTER. There're different ways, for example:
where DATETRUNC() - the beginning of the current quarter (01/07/2022),
DATEADD('quarter', 1) - obviously add 1 quarter (01/07/2022)
And -1 day to find the of the current quarter.
And when you create a Parameter, you should refer to this Calculated Field:

Qlikview Replace WeekSeq number with week number

I have a master calendar that includes week and weekseq, weekseq is just an autonumber of week and year. I am having an issue with the column labels on a 52 wk report that works of current week back 52 weeks. When i use weekseq as the column header it works out correctly but this header is of no use, Is there a way for me to replace weekseq with week in my column header? I have currently been trying =week(max(WeekSEQ)) for current week but not working out as it should.
Thanks
for sure :
=week(max(WeekSEQ))
is incorrect as WeekSeq is autonumber and week process date or timestamp field only.
So you need to have Date field in your calendar and use it:
=week(max(*date_field*))
(if you don't have date field you can create it but for that I need at least snapshot of your datamodel - you can make screenshot of table viewer which you can access using Ctrl+T)

Adjust Date values based on a parameter value in SSRS

We have a SSRS report with Year , Start-Date, End-Date Fields ( Start-Date and End-Date are Date controls and Year is a Combo Value). I need the value of Start-Date and End-Date to be Restricted based on Year value.
For eg: If the Year value is 2016, then the Start-Date and End-Date value should be between 01/01/2016 and 12/31/2016.
How to do this in SSRS?. Please Help
I'd use the Year value to determine if StartDate and EndDate are dates between Year. Using a expression you can get the year from StartDate and compare it against Year value, based on that comparision you can set another parameter (StartDateHidden) which is hidden for users and populated depending on the comparision.
Expression for StartDateHidden.
=IIF(
Paramaters!StartDate.Value.Year = Parameters!Year.Value,
Paramaters!StartDate.Value,DateSerial(Parameters!Year.Value,1,1)
)
Note it populates StartDateHidden with the StartDate value if it is a date in Year value, otherwise it will set the first date of the Year value.
You can use any default value for cases when StartDate is not in the Year value.
Expression for EndDateHidden.
=IIF(
Parameters!EndDate.Value.Year = Parameters!Year.Value,
Parameters!EndDate.Value,DateSerial(Parameters!Year.Value,12,31)
)
Let me know if this helps.
This can be accomplished with one drawback. Your date picker will no longer be a calendar it will be a drop down list with the dates.
Create a query that produces the list of dates you are looking for and add it to the report as a data set. Then in the properties of your Start-Date and End-Date report parameters click on the default values pane. Choose get values from query, select the appropriate dataset, value field, and label field.
After that when you run the report you will have a drop down with the list of dates your query returned. Just make sure you make your dates query dependant on the year report parameter.

How to get month within a range vb2010

I just don't know how to go about this.
I designed a program that uses MS Access as its database. I have a field for month and year (the field data type is text) where user can register details. The program will register the month and year the user have chosen e.g month= September, year=2011.
My problem now is how to chose a range of data to view by the user using the month and year as a criteria e.g the User may want to view data range from (September 2011 to July 2013).
I couldn't figure out even how to try. Help will be highly appreciated.
Perhaps you could change your application logic to store the month and year as their respective numbers rather than text and change the field data types to numeric.
You could then construct a DateTime object from them, for example September would be 9 and you could use code like the following:
var startDate = new DateTime(year, month, 1); // get year and month as integers from database, uses the first as the date
var endDate = new DateTime(year, month, 10); // change the date but keeps the month and year the same
var endDate2 = startDate.AddMonths(1); // adds 1 month to the date
Alternatively, you could try using a calendar control to allow the user to select two dates instead of building it from a number of fields. Depending on what you are using this could be achieved a number of ways, for example in ASP.Net or WPF you could use two calendar controls and just use their SelectedDate properties as your range.
A range is from a startpoint until an end point. For the startpoint you can add automatically the first of Month. For the endpoint is it more complicated because there is no fix endpoint. What you can do is following:
Write an array that contains for each month the days (e.g. 30 or 31). Except for Febrauary there is a fix pattern.
for Febrauary use the selected year to check is the year a leap year or not. If not add 28, else add 29.
After that create the date string for your SQL:
Startdate 1.9.2011. Do for the entdate the same.
After that, I think you can use the keyword between in your SQL query.
You can assume that everything is entered on the first day of each month. I would pull the information using a query to the database.
select * from [tablename] where DateSerial([colYear], [colMonth], 1) between DateSerial([fromYear], [fromMonth], 1) and DateSerial([toYear], [toMonth], 1)
In this question are some ways to do this:
First. Filter the dates in a range assuming that you use a date like '07-12-2012'
i.e. September 2011 to July 2013
Where DateColumn > '09-01-2011' and DateColumn < '07-31-2013'
OR
Specify a Date and a Year
Where month(DateColumn)='1' and year(DateColumn)='2016'
Note:
There are many ways to do this.
You can Manipulate your statement depending on your desired output.