What is the syntax to add custom date filters, e.g. for fiscal periods?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2022 09:04 AM
I need to add entries to Date filters with absolute dates for fiscal periods, such as fiscal year 2023 which runs from July 1, 2022, to June 30, 2023. The syntax I've tried below (and variations) returns no results:
answer.add('180_FY23@javascript:gs.Date(2022-07-01)@javascript:gs.Date(2023-06-30)', gs.getMessage('FY23'))
What is the correct syntax that should be used?
Thanks in advance for any insight!
- Labels:
-
Dashboard
-
Performance Analytics
-
Reporting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2023 12:54 PM
I ended up following this article. which is essentially to create this client-callable script include (Sncdemo_dfGetFiscalFilter😞
var Sncdemo_dfGetFiscalFilter = Class.create();
Sncdemo_dfGetFiscalFilter.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getBeginningOfLastYear: function () {
return gs.beginningOfLastSchedulePeriod("3f682e11d7222100738dc0da9e610353", "Last fiscal year");
},
getEndOfLastYear: function () {
return gs.endOfLastSchedulePeriod("3f682e11d7222100738dc0da9e610353", "Last fiscal year");
},
getBeginningOfThisYear: function () {
return gs.beginningOfThisSchedulePeriod("3f682e11d7222100738dc0da9e610353", "This fiscal year");
},
getEndOfThisYear: function () {
return gs.endOfThisSchedulePeriod("3f682e11d7222100738dc0da9e610353", "This fiscal year");
},
getBeginningOfNextYear: function () {
return gs.beginningOfNextSchedulePeriod("3f682e11d7222100738dc0da9e610353", "Next fiscal year");
},
getEndOfNextYear: function () {
return gs.endOfNextSchedulePeriod("3f682e11d7222100738dc0da9e610353", "Next fiscal year");
},
type: 'Sncdemo_dfGetFiscalFilter'
});
and then adding these lines to the BR:
answer.add('210_Last fiscal year@javascript:new Sncdemo_dfGetFiscalFilter().getBeginningOfLastYear()@javascript:new Sncdemo_dfGetFiscalFilter().getEndOfLastYear()', gs.getMessage('Last fiscal year'));
answer.add('220_This fiscal year@javascript:new Sncdemo_dfGetFiscalFilter().getBeginningOfThisYear()@javascript:new Sncdemo_dfGetFiscalFilter().getEndOfThisYear()', gs.getMessage('This fiscal year'));
answer.add('230_Next fiscal year@javascript:new Sncdemo_dfGetFiscalFilter().getBeginningOfNextYear()@javascript:new Sncdemo_dfGetFiscalFilter().getEndOfNextYear()', gs.getMessage('Next fiscal year'));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2024 07:12 AM
How did you set up an interactive filter on a dashboard to use? I have one set up but these dates do not filter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2024 05:36 AM
Hello ,
for some reason I cant able to open that article . So , Could you please explain how this works.What is the Sys Id used in the script.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2024 04:41 PM - edited 09-01-2024 05:43 AM
If anyone still needs a solution for this, I figured it out and wrote a post about it here.