I. Overview
There is a date-type data column in the database. When you want to input a date, the data of the quarter of the date can be queried, as shown in the figure below. How to achieve this?
II. Example
1) Opening the template
Open the template:%FR_HOME%\webroot\WEB-INF\reportlets\doc-EN\Parameter\Weekly_report.cpt
2) Parameter settings
You only need to change the weekly report in the parameter interface to the quarterly report. The table sample and parameter type in the parameter interface do not need to be modified.
3) Setting filter conditions
Delete the filter condition of the original A2 cell, and then set the filter condition for A2 cell again, as shown in the figure below:
The first formula:YEAR(Payment date) ==YEAR($Date);
The second formula:ROUNDUP(MONTH(Payment date)/3.3,0) ==ROUNDUP(MONTH($Date)/3.3,0) ==ROUNDUP(MONTH($Date)/3.3,0)The quarter representing the order date should be the same as the quarter of the query.
Note:ROUNDUP(MONTH(Payment date)/3.3,0) represents the quarter in which the month is retrieved.ROUNDUPis rounded up so that multiples of 3 are in the corresponding quarter, so the number 3.3 can be any decimal between 3 and 4. If it's June, six divided by 3.3 and rounded up is two, which means six in the second quarter, and so on. The second argument, 0, takes the decimal place to be 0.
Save the template, click Pagination Preview, and select a date to query only the data for the quarter of the date, as shown above.
For details, see the template: %FR_HOME%\webroot\WEB-INF\reportlets\doc-EN\Parameter\Quarterly_report.cpt