Oracle Analytics Publisher (BIP)

Products Banner

How to Add Conditional Region Based on a Calendar Date (RTF Template)?

Received Response

I am trying, without success, to add a conditional region to an RTF template (Word) based on a date value in my XML.

The logic is quite simple: If the date is on or before 10/1 (October 1), then show this region

The value from the XML output is HIRE_DATE

I have tried multiple ways to get this to work with no success. The documentation does not provide any examples and all the guidance from MOS and CCC is to go to the documentation.

Idea 1: Get month and date, check if it is less than or equal to October 1st:


That didn't work and triggers this error: XPathException: Parse Error in to_date function.

Idea 2: Append Year to October 1st and compare to HIRE_DATE:

<?if:HIRE_DATE<to_date(LIP_YEAR || '-10-01','YYYY-MM-DD')?>

This one doesn't error, but it doesn't render the region when the condition is met.

I tried a lot of other ways to do it, too, including using the get_day and get_month functions, but they trigger errors, too if I use them in a formula (I can get the month numeric value and the day numeric value, but I can't use them together.

There is one additional region that I need to show, but based on the opposite condition. But first things first, I have to figure this out. Any thoughts?