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)
Using numeric values from a data set in a global Variable
lenburt
Hello out there --
I am trying to accumulate numeric values across data sets with the intent of computing a total at the bottom of my document. The statement below seem to expect a string as the second argument (as opposed to a numeric value from a data set).
Is there a simple solution?
reportContext.setPersistentGlobalVariable("totalDelinqAmt",row.TOTAL_DELINQ_AMT);
regards, len
Find more posts tagged with
Comments
mwilliams
Try:
reportContext.setPersistentGlobalVariable("totalDelinqAmt",new Number(row.TOTAL_DELINQ_AMT));
Either that, or you could just make it into a string:
reportContext.setPersistentGlobalVariable("totalDelinqAmt",row.TOTAL_DELINQ_AMT.toString());
then, parse it back to a float when you retrieve it:
parseFloat(reportContext.getPersistentGlobalVariable("totalDelinqAmt"));
lenburt
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="109000" data-time="1346421450" data-date="31 August 2012 - 06:57 AM"><p>
Try:<br />
<br />
reportContext.setPersistentGlobalVariable("totalDelinqAmt",new Number(row.TOTAL_DELINQ_AMT));<br />
<br />
<br />
Either that, or you could just make it into a string:<br />
<br />
reportContext.setPersistentGlobalVariable("totalDelinqAmt",row.TOTAL_DELINQ_AMT.toString());<br />
<br />
then, parse it back to a float when you retrieve it:<br />
<br />
parseFloat(reportContext.getPersistentGlobalVariable("totalDelinqAmt"));<br /></p></blockquote>
lenburt
Ah, thanks very much...that makes perfect sense. -- len