Categories
- All Categories
- 130 Oracle Analytics News
- 23 Oracle Analytics Videos
- 14.5K Oracle Analytics Forums
- 5.5K Oracle Analytics Idea Labs
- Oracle Analytics User Groups
- 50 Oracle Analytics Trainings
- 8 Oracle Analytics Data Visualizations Challenge
- 4 Oracle Analytics Career
- 8 Oracle Analytics Industry
- Find Partners
- For Partners
Setting default values in BI Publisher

Summary
Setting default values in BI Publisher
Content
Hi,
I am trying this given piece of code in .rtf to set default value of a variable to 3 but it remains blank in .pdf generated by BI Publisher when the variable value is null. Could this be wrong syntax?
<?if:MY_VARIABLE!=''?><?MY_VARIABLE?><? else '3' ?><?end if?>
Regards,
Answers
-
Thanks for your help, Venkat-BIP. I changed my code a little in order to format numbers.
<?if:MY_VARIABLE!= '*'?><?format-number(MY_VARIABLE,'## ##0',’Yen’)?>,-<?end if?> <?if:MY_VARIABLE='*'?><?format-number(5,'## ##0',’Yen’)?>,-<?end if?>
Here I have '*' as I am using 11g and I am trying to set 5 as default value. But I am still getting the error "Cannot convert to number". could this be because of formatting default value?
0 -
Hi,
try if the <?choose:?><?when:element!=""?> statement works --> try both quotes '' and double cotes ""
For example:
<?choose:?>
<?when:MY_VARIABLE!=""?><?MY_VARIABLE?><?end when?>
<?otherwise:?>3<?end otherwise?>
<?end choose?>
also, if your tag is within a repeating group you might want to add the path
for example
<?choose:?>
<?when:MY_VARIABLE!='""?><?./G_1/MY_VARIABLE?><?end when?>
<?otherwise:?>3<?end otherwise?>
<?end choose?>
Let us know if that works
Regards,
Youssef
0 -
can you upload xml and rtf template. Thanks
0 -
It's a number. A double. It's from a data model created as a result of a query.
0 -
what exactly my variable is storing ? it is number or varchar. what is the source for myvariable ?
0 -
<?xdofx:if MY_VARIABLE!= '*' then XXXX
else
if MY_VARIABLE!= '*' then XXXX
else
XXXX
end if?>
try using this which might be helpful if u can do it in case.
0 -
xdofx:if $FAC!='*' then 'ALL FACILITIES' else $FAC end if ?> ,replace $fac with your variable OR <?xdofx:if $FAC!='' then 'ALL FACILITIES' else $FAC end if
0 -
first please check in bip data model how the null value is generating. example in bip 12c null value can be treated as '' in bip 11g it will treat as '*' , sometimes RTF template wont recognise null as null it will treat as * value. please try with different combinations as '' or '*'.
0 -
Thanks a lot, Youssef. Using <?choose?> worked. Since MY_VARIABLE is defined beforehand in my data model, how can I set default value for it? For instance:
<?otherwise:?><?MY_VARIABLE=3?><?end otherwise?>
something like that?
Regards,
0