Below is a JavaScript expression to get fiscal months starting in November.
Expression:
//replace the datetime column with your own.
var y = $val["DateDT"].getYear() + 1900
var m = $val["DateDT"].getMonth() + 1
//Do not edit beneath this line
function fpget(mth, yr)
{ if (!mth || !yr)
{ return "UNKNOWN" }
else if (mth >= 11)
{ return ("FP 0" + (mth - 10).toString() + "-" + (yr + 1).toString()) }
else if (mth < 8)
{ return ("FP 0" + (mth + 2).toString() + "-" + yr.toString()) }
else
{return ("FP " + (mth + 2).toString() + "-" + yr.toString()) }
};
var f = fpget(m, y)
f
Output:
Date time |
Fiscal Period |
7/1/2016 |
FP 09-2016 |
8/1/2016 |
FP 10-2016 |
9/1/2016 |
FP 11-2016 |
10/1/2016 |
FP 12-2016 |
11/1/2016 |
FP 01-2017 |
12/1/2016 |
FP 02-2017 |
1/1/2017 |
FP 03-2017 |
2/1/2017 |
FP 04-2017 |
3/1/2017 |
FP 05-2017 |
4/1/2017 |
FP 06-2017 |
5/1/2017 |
FP 07-2017 |
6/1/2017 |
FP 08-2017 |
7/1/2017 |
FP 09-2017 |
8/1/2017 |
FP 10-2017 |
9/1/2017 |
FP 11-2017 |
10/1/2017 |
FP 12-2017 |
11/1/2017 |
FP 01-2018 |
12/1/2017 |
FP 02-2018 |
1/1/2018 |
FP 03-2018 |
2/1/2018 |
FP 04-2018 |
3/1/2018 |
FP 05-2018 |
4/1/2018 |
FP 06-2018 |
For More Information:
- iDashboards Builder Manual 14 Analytics
- JavaScript Expression Help
Disclaimer: iDashboards Technical Support Engineers are not Data Analysts who know in depth SQL Queries or JavaScript Expressions. We often learn these skills on the job and have limited knowledge. We do our best to help you with your software in determining if: you are not leveraging the software in the best way for your data or you found a bug in the software, because we want to assist you in your success. If you have issues with in depth queries or expressions please contact iDashboards Support and know that it will take a bit of time to figure out what is necessary for this issue, and if necessary we will refer you to your Client Success Manager to schedule time with a Principal Product Engineer.
If the above is unable to resolve the issue, then please contact iDashboards Support for further assistance.
Comments
0 comments
Please sign in to leave a comment.