bo formulas & funcitons
TRANSCRIPT
-
8/13/2019 BO Formulas & Funcitons
1/3
BusinessObjects Special Topics Selected Formulas and Functions
Selected Formulas and Functions
You can downloada BusinessObjects report with examples of several of these formulas.
What You Want to Do Format/Example Notes
Calculate anddisplay a percentageof an object
=Sum(*0.3! "#e percent must be preceded by a 0(i.e.$ %0.3&! if a decimal point is used.
Convert a c#aracterstring to a date
="o'ate(c#aracter$format!
)ample +="o'ate(%,003030&$%yyyymmdd&!
-esult+ 030,003
"#e single value or variable is follo/edby t#e e)isting format of t#e string.
"#is function can be used in If ThenElse statements. f t#e variable t#atfollo/s Thenis date1type$ t#e variablet#at follo/s Else must also be date1type.
Convert a c#aracterstring to a number ="o2umber(c#aracter!)ample+ ="o2umber(%34&!
-esult+ 34.
"#is function can be used in If ThenElse statements. f t#e variable t#atfollo/s Thenis numeric$ t#e variablet#at follo/s Else must also be numeric.
"#is function /or5s /it# bot# constantsand variables.
Convert a date to ac#aracter string sot#at it is compatible/it# ot#er elementsin a formula
=6ormat'ate(date$ string format!
)ample+
=6ormat'ate(
-
8/13/2019 BO Formulas & Funcitons
2/3
BusinessObjects Special Topics Selected Formulas and Functions
What You Want to Do Format/Example Notes
Create a table /#ereevery ot#er ro/ iss#aded
Variable formula:
=od(;ine2umber(!$ ,!
lerter:
=
. Create a variable /it# t#e formuladisplayed at left. "#e formula c#ec5st#e line number for eac# ro/ and returnsa value of for any ro/ /it# a line
number t#at is evenly divisible by avalue of ,.
,. ?ig#lig#t all columns of t#e table (butnot t#e #eaders!. Create an alerterbased on t#e ne/ variable /#ic# s#adesevery ro/ for /#ic# t#e value of t#evariable is . 9nder !ell !ontent"Format#$ go to Shadin$and select t#edesired s#ading option.
Create a variablet#at displays firstname and anot#ert#at displays lastname based on avariable t#at displays;7S" 27$6-S"27$ e.g.'@$A72
%ast name:
=SubStr( $ $(Bos( $$!1!!
First name:
=SubStr( $(Bos( $$!!D $;engt#(!1(Bos( $ $! !!
First name &for 'ariable (ith a space afterthe comma):
=SubStr( $(Bos( $$!!*+$;engt#(!1(Bos( $ $!!
"#e Substr(! function e)tracts ase8uence of c#aracters from a c#aracterstring.
"#e first formula says+ start at position $display all c#aracters up to one positionbefore t#e comma.
"#e second formula says+ start onec#aracter past t#e comma and displayt#e number of c#aracters t#at resultsfrom t#is calculation+ t#e total number ofc#aracters in t#is field minus t#e positionnumber of t#e comma.
Note+ f t#ere is a space after t#ecomma$ t#e first name formula s#ouldstart , c#aracters after t#e comma.
Create calculationst#at ignore filters ona document
=2o6ilter(formula!
)ample+ =2o6ilter(a)(!!
-eturns t#e calculation performed ondata /it# all filters on t#e data ignored.
'isplay t#e currentpage number
=Bage(!
)amples+
=&Bage & F 6ormat2umber (Bage(!$ :!
"#e page number /ill only displaycorrectly in Bage ;ayout vie/ (ie/$Bage ;ayout!. "#e e)ample uses t#e6ormat2umber(! function to convert t#epage number to a c#aracter string andconcatenates t#e number /it# te)t.)ample+ %Bage .&
'isplay t#e last time
a document /asrefres#ed
=;ast)ecution'ate(data provider!
)ample+ =;ast)ecution'ate(Euery /it#67S?@2!
9se t#e Number tab of t#e !ell Format
dialog bo) to format t#e date.
Select Insert" Special Field" Date andTime" %ast ,efresh to insert t#isformula automatically.
3,0,003 ,
-
8/13/2019 BO Formulas & Funcitons
3/3
BusinessObjects Special Topics Selected Formulas and Functions
What You Want to Do Format/Example Notes
'isplay t#e name oft#e document
=DocumentName()
Example:
=Sustr(DocumentName() !1 !"en#th(DocumentName())$%)
"#e e)ample displays t#e documentname /it#out t#e .rep e)tension. t usest#e SubStr and ;engt# functions to ta5ea string from t#e document name$
starting in position $ returning t#e lengt#of t#e document name minus t#e last Gc#aracters.
'isplay userresponse to aprompt.
=9ser-esponse(data provider$ prompt!
)ample +
=9ser-esponse (Euery /it# 67S?@2 $enter state!
)ample ,+
=9ser-esponse ('ataBrovider(! $state!
Select Insert" Special Field" -uer.rompt from t#e main menu to insertt#is formula automatically.
n )ample $ t#e data provider name is#ard coded and /ould #ave to be editedif t#e 8uery name /ere c#anged.
)ample , uses t#e 'ataBrovider(!function /#ic# re8uires t#at you specifya variable (in t#is case$ !.
Suppress blan5values in a column
=s2ull(c#aracter string or number or date!
)ample+ =2ot s2ull(!
"o suppress eroes rat#er t#an nulls$ use t#isformula+ =