Highlighting with Multiple Conditions

Options
joleslie
edited February 11, 2022 in Analytics #1
<p>Hi All,</p>
<p> </p>
<p>I'm trying to highlight a cell red if it does not match one of two conditions. The conditions are as follows:</p>
<ul><li>row["parentPath"] must contain the words "Logical Model"<br>
or</li>
<li>row["parentPath"] must contain the word "Physical"</li>
</ul><p>The words it contains will not be the entire content of the cell (eg it may be "Logical Model Dev"), so it must allow any text before or after those words. If any of those words are included the cell is to be white, if none then the cell should highlight red.</p>
<p> </p>
<p>I have tried many variations on the highlight filter and came to the conclusion that I must do them on the same condition. If I do them separately everything ends up as highlighted red.</p>
<p> </p>
<p>When combining them I believe the following should work, but it does not:</p>
<ul><li>Function: row["parentPath"] == /Logical Model/ || row["parentPath"] == /Physical/</li>
<li>Is False</li>
</ul><p>(I have also tried adding " before and after the words eg "/Logical/" to no avail)</p>
<p> </p>
<p>The only thing I can get to work is</p>
<ul><li>row["parentPath"] Not Match /Physical/</li>
</ul><p>but I cannot add a second condition to this, as when I do everything highlights red.</p>
<p> </p>
<p>I am using Eclipse BIRT Designer Version 4.2.2.v20130311740 Build <4.2.2.v20130301-1759>, and have no ability to change the version due to packaging restrictions within my organisation.</p>
<p> </p>
<p>Any help or advice you can give me would be most appreciated.</p>

Comments

  • <p>Hi,</p>
    <p> </p>
    <p>If you need to look for a string, such as "Physical", inside another string, you should use an indexOf function. For example:</p>
    <pre class="_prettyXprint _lang-">
    BirtStr.indexOf("Physical",row["parentPath"]) >= 0 || BirtStr.indexOf("Logical Model",row["parentPath"]) >= 0
    </pre>
    <p>If this expression is False, i.e. does not contain either "Physical" or "Logical Model", it will be in red.</p>
    <p> </p>
    <p>The attached sample report, based on Classic Models, shows how it works. It highlights product vendors whose name doesn't include "Mini" or "Art".</p>
    <p> </p>
    <p>Hope this helps,</p>
    <p> </p>
    <p>P.</p>
    Warning No formatter is installed for the format ipb