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)
Regular Expression Filter in Aggregate Field
dbmathis
Hi,<br />
<br />
Perhaps someone can help me out with this. I need to use a regular expression for a aggregate field filter. I need to return true if row["name"] appears in reportContext.getPersistentGlobalVariable("orgMember").<br />
<br />
Right now I have this, but the COUNT aggregate returns 0 even though I know that row["name"] appears in reportContext.getPersistentGlobalVariable("orgMember").<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>var myregexp = /(row["name"])/;
var match = myregexp.exec(reportContext.getPersistentGlobalVariable("orgMember"));
if (match != null) {
1;
} else {
0;
}</pre>
<br />
For example:<br />
<br />
row["name"]<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>Rob A Tray</pre>
<br />
reportContext.getPersistentGlobalVariable("orgMember")<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>[Rob A Tray, Mich Ant, Bill West]</pre>
<br />
<span class='bbc_underline'><strong class='bbc'>Update</strong></span><br />
<br />
I have noticed that for some reason reportContext.getPersistentGlobalVariable("orgMember") doesn't seem to have any data in it in the aggregate element. I added it to the expression for the concatenation aggregate and it returned no data. I wasn't able to find any documentation whether I can use a global variable in an aggregate element but I know the global variable has data. I put it into a data element in the same table and it returns data. The global variable is being populated in the row that the aggregate element is in, in the onRender.
Find more posts tagged with
Comments
There are no comments yet