Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
subtract Value from previous group
mkbock
<p>Hi,</p><p>i have created a table with Groups. The Group interval is per Year. My challange is not to subtract the aggregated (AVE) Result from 2012 from the Result from 2013. Any ideas to do that?</p><p>Means Subtract a aggregated group Value from the following one...</p><p>Thanks Michael</p>
Find more posts tagged with
Comments
kclark
<p>Is the aggregated average value in the footer of the group? You could set a persistent global variable in the initialize() of your report. Then do something like this in the onRender() of the aggregated value</p><pre class="_prettyXprint">var oldValue = parseFloat(reportContext.getPersistentGlobalValue("lastValue"));if(oldValue == 0) { // do nothing because this is the first group}else{ var newValue = oldValue - this.getValue(); reportContext.setPersistentGlobalVariable("newValue", newValue.toString()); reportContext.setPersistentGlobalVariable("lastValue", this.getDisplayValue());}</pre><p>Then you can recall the PGV newValue somewhere else to display it, or if you want it displayed there you could do</p><pre class="_prettyXprint">this.setDisplayValue(newValue);</pre><p>I haven't tried that code, but it should be something close to that, let me know if you need any help
</p>
mkbock
<p>Hi kclark,</p><p> </p><p>thanks for your help. Works perfect!</p>
kclark
<p>You're welcome!
</p>