Oracle Analytics Publisher

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

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

Received Response
39
Views
1
Comments
MarkPescatrice
MarkPescatrice Rank 2 - Community Beginner

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:

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

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?

Tagged:

Answers

  • Kevin M-Oracle
    Kevin M-Oracle Rank 6 - Analytics Lead

    What is the value of HIRE_DATE displayed in your data model?

    Is there a reason you cannot use the year in your conditional?

    Thx,

    Kevin