Search code examples
rtfbi-publisher

How to filter value based on specific word in BI Publisher using RTF


how can I filter attribute output based on word. for example

<?Store_Location?> --> I just want to show stores in NY

tried <?if:Store_location Contains ('NY')?> but its not working.

Thank you


Solution

  • You are using the wrong syntax. Try this:

    <?if:contains(Store_location,'NY')?>
    

    Example XML

    <record_set>
    <record>
    <rownum>1</rownum>
    <transaction_id>111</transaction_id>
    <amount>200</amount>
    </record>
    <record>
    <rownum>2</rownum>
    <transaction_id>222</transaction_id>
    <amount>300</amount>
    </record>
    <record>
    <rownum>3</rownum>
    <transaction_id>333</transaction_id>
    <amount>430</amount>
    </record>
    <record>
    <rownum>4</rownum>
    <transaction_id>444</transaction_id>
    <amount>200</amount>
    </record>
    </record_set>
    

    Example RTF

    <?for-each:record_set?>
    <?for-each:record?>
    <?if:contains(amount,'3')?>
    Transaction ID: <?transaction_id?>
    Amount:<?amount?>
    <?end if?>
    <?end for each?> 
    <?end for each?>