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)
Creating Array from dataset accounting for parameter input
mgrawburg
<p>Hello,</p>
<p> </p>
<p>I am trying to create an array and populate it with values from my dataset. I will then do some operations with the array. I am using Tririga, so everything comes through as Java Objects, hence the .getNativeValue() function appended to the row.</p>
<p> </p>
<p>In the 'Initialize' step, I declare my array:</p>
<p>myArray = [];</p>
<p> </p>
<p>In the 'onFetch' step, I populate the array:</p>
<div>arrayLength = myArray.length;</div>
<div>myArray[arrayLength] = dataSetRow["triProject__triREProject____triIdTX"].getNativeValue();</div>
<div> </div>
<div>I called the array in a Dynamic Text object on my report to see what it spits out:</div>
<div>myArray;</div>
<div> </div>
<div>The issue I am running into is that the array seems to not take into account the parameters I prompt for that filter out information based upon the record's Received Date. I am, instead, just getting the ID numbers of all the records that pop out from the Tririga system.</div>
<div> </div>
<div>Am I missing some steps in my array creation or usage? Should I be putting the code in different steps of the report creation?</div>
<div> </div>
<div>Thanks for the assistance!</div>
Find more posts tagged with
Comments
mgrawburg
<p>I finally got this array working. Instead of populating myArray in the 'onFetch' step, I placed that code in the 'onCreate' step of the Table. Now, the contents of myArray do take the parameter into account.</p>
mgrawburg
<p>Just kidding, this solution does not work. It will only pull the first result element into the array as opposed to iterating over the entire set. Back to the drawing board...</p>