Need to pull report Due date to expiry before 7days on website table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 03:31 AM
Hello Team,
Please find query below,
I want to pull the report when due date to expiry before 7 days. Please let me know how to add condition in report.
I have used below condition but not working and need exact 7days before result, not required 7days more or less data.
Due -relative before 7 days from now.
Report on cmdb_ci_web_site table
Thanks in advance.
Regards,
Srinath.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 03:59 AM
To pull a report on the cmdb_ci_web_site table for records where the due date is exactly 7 days before the current date, you can use the following condition:
Due-7d@javascript:gs.dateGenerate(gs.nowDateTime(), 'start')@javascript:gs.dateGenerate(gs.nowDateTime(), 'end')
This condition will return records where the due date falls exactly 7 days before the current date, without including any records with due dates more or less than 7 days before the current date.
To apply this condition to your report:
- Go to the report editor and select the cmdb_ci_web_site table.
- Add a filter for the Due field.
- In the filter condition, select the "Relative" option and enter the following string: Due-7d@javascript:gs.dateGenerate(gs.nowDateTime(), 'start')@javascript:gs.dateGenerate(gs.nowDateTime(), 'end')
- Save the filter and run the report to view the results.
Note: This condition assumes that the "Due" field in your cmdb_ci_web_site table is a date/time field. If it is a string field, you may need to modify the condition to convert the string to a date/time format before applying the relative date calculation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 05:07 AM
I am not able find above options except "before" and "after" please find screenshot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 09:54 PM - edited 04-06-2023 10:16 PM
@Srinath Pasulad wrote:I am not able find above options except "before" and "after" please find screenshot
Navigate to the Reports module in the left-hand navigation pane.
Click on the New button to create a new report.
Select the cmdb_ci_web_site table as the data source for the report.
Click on the Add Condition button to add a new condition.
Enter due_on as the field name for the condition.
Select is as the operator for the condition.
Enter the following value for the condition: "javascript:gs.dateGenerate(gs.nowDateTime(), -7).getDate();"
Click on the Run button to preview the report.
If the report looks correct, click on the Save button to save the report for future use.
This should generate a report on the cmdb_ci_web_site table that shows only records where the due date is exactly 7 days before the current date.
TRY THIS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2023 10:13 PM
Could you please provide screenshot of filter condition , actually i am not able see the options.