Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3273

Re: "Suppress Zeros" option in script?

$
0
0

Hi Lori,

 

There is no direct method for suppressing zeroes in scripting, but there is a workaround for the same.

 

var members = DS_1.getMembers("Your_Dimension", 100000);

var filter_string = "";

var temp = "";

members.forEach(function(element, index) {

  DS_1.setFilter("Your_Dimension", element.internalKey);

  temp = DS_1.getDataAsString("Key_Figure", {}).substring(0,2);

  if(Convert.stringToInt(temp) <= 0)

  {

  filter_string = filter_string + "!" + element.internalKey + ";";

  }

});

DS_1.setFilterExt("Your_Dimension", filter_string);

 


Try this code snippet. It would get you the required output.


This would work for only one Key Figure. For multiple Key Figures, the for loop should be implemented for individual Key Figures.

 

 

Regards,

Nirmal Kumar


Viewing all articles
Browse latest Browse all 3273

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>