Skip to Content
avatar image
Former Member

how to get max or min value from dimension/measure in sap design studio

how to get max or min value from dimension/measure using script in sap design studio

like year or revenue

2014 2015 2016 the last year 2016 initialization display on the dropdown box ?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Nov 02, 2017 at 08:16 PM
    Add comment
    10|10000 characters needed characters exceeded

    • Hi Zheng,

      I guess your requirement is to set filter and pre-select dropdown for current year or previous year for "0calyear" list. Try below code and see if this is what you are looking for.

      Note: setting ascending or descending from "Edit initial view" will ONLY affect your Crosstab view but not Drop-down that populates data out of query.

      For Current Year - 2017
      //populate dropdown list
      DROPDOWN_1.setItems(DS_6_HR_FILTER.getMemberList("0CALYEAR", MemberPresentation.TEXT, MemberDisplay.TEXT, 20));
      //set current year for dropdown
      DROPDOWN_1.setSelectedValue(Convert.stringToInt(Convert.subString(APPLICATION.getInfo().dateNowInternalFormat, 0,4))+ "");
      //set query filter
      DS_6_HR_FILTER.setFilterExt("0CALYEAR", Convert.stringToInt(Convert.subString(APPLICATION.getInfo().dateNowInternalFormat, 0,4))+ "");
      
      For Previous Year - 2016
      //populate dropdown
      DROPDOWN_1.setItems(DS_6_HR_FILTER.getMemberList("0CALYEAR", MemberPresentation.TEXT, MemberDisplay.TEXT, 20));
      //set previous year for dropdown
      DROPDOWN_1.setSelectedValue((Convert.stringToInt(Convert.subString(APPLICATION.getInfo().dateNowInternalFormat, 0,4))-1 )+ "");
      //set previous year filter
      DS_6_HR_FILTER.setFilterExt("0CALYEAR", (Convert.stringToInt(Convert.subString(APPLICATION.getInfo().dateNowInternalFormat, 0,4))-1 )+ "");
      

      Regards,

      Fahad