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)
Is there a wild card option in expression builder or suppress.
HSMorales
<p>I am trying to suppress some fields in a row if the first field contains 'NP'. such as.</p>
<p> </p>
<p>field1 == '%NP%'</p>
<p> </p>
<p>I also want to use this as a filter in an aggregate group total to exclude the row from the group total.</p>
<p> </p>
<p>How can I do this ?</p>
<p> </p>
<p>Thanks</p>
<p> </p>
<p>Henry Morales</p>
<p>BIRT 4.5</p>
<p> </p>
<p> </p>
Find more posts tagged with
Comments
Matthew L.
<p>You can use a regex match expression with a "is true" or "is false" filter type.</p>
<div>The regex wildcard character(s) to simulate a LIKE % character is ./</div>
<div>for example, your filter can be:</div>
<div> </div>
<div>var dataRow = row["field1"];</div>
<div>if (dataRow.match(/.*NP.*/) )</div>
<div>{true;}else{false;}</div>
<div> </div>
<div> </div>
<div>For reference, to include 2 or more filter values:</div>
<div> </div>
<div>var dataRow = row["field1"];</div>
<div>
<div>if (dataRow.match(/.*NP.*/)</div>
<div>|| dataRow.match(/.*PN.*/) ) //Use || for OR within the IF statement for additional filters</div>
<div>{true;}else{false;}</div>
<div> </div>
<div> </div>
</div>
<p>Attached is an example that filters on the group row and filters out any customer name with "Gift" in the name.</p>
HSMorales
<p>Worked great. Thanks.</p>
micajblock
<p>Wouldn't string.indexOf be simpler?</p>