Skip to Content
avatar image
Former Member

Populating values for Drop down in Financial Year format

I need to display financial Year in the drop down I,e (2017-18) format. for the backend we are using as BW.we are having Year and year month dimensions maintained in the backend.I tried several option but didn't get desired result set

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Sep 25, 2017 at 12:14 PM

    Hi Afzal,

    You can try the following code to achieve the desired result:

    var myYears = DS_1.getMembers(<Year Dimension>, 10);
    var yearText = "";
    var yearNum = 0;
    
    myYears.forEach(function(year, index) {
    
      yearNum = Convert.stringToInt(year.internalKey);  
      yearText = (yearNum - 1) + "-" + year.internalKey.substring(2);   
      DROPDOWN_1.addItem(yearNum + "", yearText); 
      
    });
    

    Regards,

    Mustafa.

    Add comment
    10|10000 characters needed characters exceeded