Skip to Content
avatar image
Former Member

Design studio script fixeates filter?

I am new to design studio, but I created a script in a financial dashboard, to "force" it to show the current month and current fiscal year default.

However I want it to be flexible, so the user can navigate to other periods using a filter pane.

That works perfectly fine for the year dimension, but my period seem to be fixed, so right now the default view is 2017 - April figures. In the filter pane I can change the year, but the period remains fixed to april, so I can navigate to e.g. April 2016, or April 2015, but not say January 2017.

The script is below:

var CURR_Year = "K020" + Convert.subString(APPLICATION.getInfo().dateNow, Convert.stringLength(APPLICATION.getInfo().dateNow)-2);

DS_2.setFilter("0FISCYEAR",CURR_Year); var monthNum = Convert.subString(APPLICATION.getInfo().dateNowInternalFormat, 4,6); var

monthNumber=""; if (monthNum=="02") {monthNumber="01";}
else if(monthNum=="03") {monthNumber="02";}
else if(monthNum=="04") {monthNumber="03";}
else if(monthNum=="05") {monthNumber="04";}
else if(monthNum=="06") {monthNumber="05";}
else if(monthNum=="07") {monthNumber="06";}
else if(monthNum=="08") {monthNumber="07";}
else if(monthNum=="09") {monthNumber="08";}
else if(monthNum=="10") {monthNumber="09";}
else if(monthNum=="11") {monthNumber="10";}
else if(monthNum=="12") {monthNumber="11";}
else if(monthNum=="01") {monthNumber="12";}

var CP=Convert.stringToInt(monthNum); var MonthLag=CP-1;

var CP_string=Convert.floatToString(MonthLag,"#"); var MTD="00"+CP_string;


DS_2.setFilter("0FISCPER3", MTD);

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers