Categories
- All Categories
- 15 Oracle Analytics Sharing Center
- 15 Oracle Analytics Lounge
- 208 Oracle Analytics News
- 41 Oracle Analytics Videos
- 15.7K Oracle Analytics Forums
- 6.1K Oracle Analytics Idea Labs
- Oracle Analytics User Groups
- 76 Oracle Analytics Trainings
- 14 Oracle Analytics Data Visualizations Challenge
- Find Partners
- For Partners
AND Not working inside if statement in BI Publisher template

Summary
AND Not working inside if statement in BI Publisher template
Content
Hi Experts,
Below expression error out when sample xml was loaded into RTF template on word and trying to generate PDF. "BookingMRC" and "TotalMRC" and xml tag in the sample xml.
Not working:
<?if:BookingMRC != '' AND TotalMRC != '' AND TotalMRC > 0 AND BookingMRC < 0?>
Increase%: <?xdoxslt:round((((-BookingMRC) div TotalMRC)*100),2)?> %
<?end if?>
Working:
<?if:BookingMRC != ''?><?if:TotalMRC != ''?><?if:TotalMRC > 0?><?if: BookingMRC < 0?>
Increase%: <?xdoxslt:round((((-BookingMRC) div TotalMRC)*100),2)?> %
<?end if?><?end if?><?end if?><?end if?>
Why not working with first approach?
Thanks,
Vinay
Answers
-
Additional info on "Not working" scenario. The error happens when TotalMRC is Null in XML.
for e.g.,<TotalMRC/>
Thanks
0 -
Nope...I put 'and' in small case....XML publisher will not accept upper case 'AND'.
0 -
<?if:BookingMRC != '' and TotalMRC != '' and TotalMRC > 0 and BookingMRC < 0?>
Increase%: <?xdoxslt:round((((-BookingMRC) div TotalMRC)*100),2)?> %
<?end if?>
Can you try the above?
0 -
Are you using this to hide or display a field? If so, the <?choose"> statement works well for this and the <?when:?> can contain xdoxslt.
0 -
What is the error? this should work. If you can, please post a sample XML to test.
0 -
Hi,
Because BI Publisher has extended set of SQL and XSL functions in RTF Templates.
Whereas we cannot not use mix them within one expression as suggested by the oracle team.
As you mentioned in the first expression with AND Operand is belongs to SQL and whereas you are using it in XSL expression.
It's one of the primary reason the expression is not working as expected
Regards
Pavan
1 -
Hi Expert,
Thanks for your reply. I have marked case sensitive "and" as correct answer as that worked out for me.
-Vinay
0