0% found this document useful (0 votes)
1K views

In, ForEach & ForAll Context Operator in BO - SAP BO, BI, Database & Data Warehouse FAQ

The document discusses the IN, ForEach, and ForAll context operators in SAP BusinessObjects (BO). It provides examples of how each operator can be used to specify the context for calculations in BO reports. The ForEach operator adds dimensions to the context, the ForAll operator removes dimensions from the context, and the IN operator specifies which dimensions to include in the context while ignoring others present in the report block. The document also discusses how these operators can be used to set the input, output, and reset contexts for calculations.

Uploaded by

Uma Shankar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views

In, ForEach & ForAll Context Operator in BO - SAP BO, BI, Database & Data Warehouse FAQ

The document discusses the IN, ForEach, and ForAll context operators in SAP BusinessObjects (BO). It provides examples of how each operator can be used to specify the context for calculations in BO reports. The ForEach operator adds dimensions to the context, the ForAll operator removes dimensions from the context, and the IN operator specifies which dimensions to include in the context while ignoring others present in the report block. The document also discusses how these operators can be used to set the input, output, and reset contexts for calculations.

Uploaded by

Uma Shankar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

12/24/2014

IN,ForEach&ForAllContextOperatorinBO|SAPBO,BI,Database&DatawarehouseFAQ

SAPBO,BI,Database&DatawarehouseFAQ| SubscribetoRSSFeed
WhyWeFollowtheWayifWecanLeadthe
SelectTopicsCategory
Way
SelectCategory

DearTechie!!
Welcometobobi.blog.comatechnoworldofBusinessIntelligence.
Throughthisblog,IhavetriedtoinitiateandsharemytechnialskillsinareaofSAPBusiness
Intelligence,SAPVisualIntelligence,BusinessAnalytics,Datawarehouse,Reportingand
databasesolutions.
Iwouldinviteandencourageyoutoreadthepostsandshareyourcommentandexpertiesonthe
topicsmentionedintheblogssothatthisblogcouldturnintotruehelpforthebeginnersandthe
advancelevelpractitionerofSAPBO/BI.
Thanksinadvanceforyourvaluablecontribution!!

IN,ForEach&ForAllContextOperatorinBO
FiledunderBO/BIAdministrationbyDeepakChaubeyon10032014
ForEachcontextoperator
TheForEachoperatoraddsdimensionstoacontext.i.e.ForEachisusedtoaddanextra
dimensionthatmightnotbeincludedintheblock(whichisvalidonlyforinputcontext).
Example:UsingForEachtoadddimensionstoacontext
ThefollowingtableshowsthemaximumrevenueforeachQuarterinareportwhichcontainsthe
Quarterdimensionbutdoesnotincludeitinthe
block:
ItispossibletocreateaformulafortheMaxQuarterlyRevenuecolumnthatdoesnotincludethe
ForEachoperator:
Max([SalesRevenue]In([Year][Quarter]))In([Year])

Authors
DeepakChaubey

AuthorIntroduction
Iamkeenenoughtolearntechnical
stuffasmuchpossible.Iusemy
leisuretimetosharemyknowledge
inareaofSAPbusinessobject,Business
Inteligence,DatawarehouseandDatabase
conceptswithcontexttodatabses(likeSql
server2005/2008/2012,Oracle
9i/10g/11i,SybaseASE,SybaseIQ,Mysql
5.5).Mypurposeistocreateasuper
BO/BI/Databaseblogwhichcontainsalmost
alltherespectivequestionsrelatedtoSAP
BOBI/BODS/HANAplatformInterviewsin
areaofadministration,developmentand
analysisfrombasictoadvancelevel.Idea
behindthisblogistosaveenoughtimefor
beginneraswellasexperiencedone.Ifyou
haveanyqueryregardinganyofthepostin
thisblog.youcanwritemeon:
[email protected]&conducts
offline/OnlinetrainingcoursesforSAP
BO/BIandBODScourses.Checkbelowlink
toknowmoreaboutme:
http://about.me/deepakchaubey

Media

UsingtheForEachcontextoperator,youcanachievethesameresultwiththefollowingformula:
Max([SalesRevenue]ForEach([Quarter]))In([Year])
Why?BecausetheYeardimensionisthedefaultinputcontextintheblock.
ByusingtheForEachoperator,youaddtheQuarterdimensiontothecontext,
givinganinputcontextof([Year][Quarter]).
ForAllcontextoperator

Subscribe
Getthelatestpostsonyouremail!

Leaveyouremailaddress

OK

TheForAllcontextoperatorremovesdimensionsfromacontext.i.e.ForAllisusedtospecifically
excludeadimension,asallvaluesofthatdimensionareused.Example:UsingForAlltoremove
dimensionsfromacontext
YouhaveareportshowingYear,QuarterandSalesRevenueandyouwanttoaddacolumnthat
showsthetotalrevenueineachyear,asshowninthe
followingblock:
Tototalrevenuesbyyeartheinputcontextneedstobe(Year)bydefault
itis(YearQuarter).Therefore,youcanremoveQuarterfromtheinput
contextbyspecifyingForAll([Quarter])intheformula,whichlookslikethis:
http://bobi.blog.com/2014/03/10/inforeachforallcontextoperatorinbo/

1/6

12/24/2014

IN,ForEach&ForAllContextOperatorinBO|SAPBO,BI,Database&DatawarehouseFAQ

Sum([SalesRevenue]ForAll([Quarter]))
NotethatyoucanusetheInoperatortoachievethesamethinginthiscasetheformulais:
Sum([SalesRevenue]In([Year]))
ThisversionoftheformulaexplicitlyspecifiesYearasthecontext,ratherthanremovingQuarter
toleaveYear.
Simply,
InputContext:ForEach
OutputContext:ForAll

Meta
IN:INisusedtoprovidealistofdimensionstobeconsidered,andanyotherdimensionspresent
intheblockareignored.

Register
Login
EntriesRSS
CommentsRSS
PoweredbyBlog.com

Inotherword,
Inisusedtospecifyexactlywhichdimensionstoincludeinacontext.Otherdimensionsin
theblockareignored.Adding/removingelementsfromtheblockdoesnotimpactthis
calculationunlessaremoveddimensionwasspecifiedinthecontext.Inthatcasea
#MULTIVALUEerrorisdisplayed.
ForEachisusedtoincludeadimensioninacontext.Thecalculationcontextisstillaffected
byothervaluesintheblock.
ForAllisusedtoexcludeadimensionfromacontext.Otherdimensionsoftheblockwillstill
beconsidered.Addingorremovingvaluesfromablockmightchangethevalue,butitwill
alwaysignoretheForAllitems.

Mostvisited
SearchWithkeyword..LikeSQL
Search

MostRecentPost
10Keyfactsyouneedtoknowbefore
planningaMigrationprojecttoSAP
BOBI4.0project
MasterConceptofSAPBOBI
versions,SupportpacksandFixpacks
&Patchlevel
MasterConceptofAuditDBinBOBI4.0
StepbyStepforestablishingRFC
ConnectionbetweenSAPBW&Data
Service
StepstoUpgradefrom11.7/3.X/4.Xto
SAPDataServices4.2
HowtoVersioncontrolinBODS

Theoperatorslistedaboveallrequireoneormoredimensionsaspartoftheirsyntax.However,
calculationcontextcanbespecifiedbymorethanasetofdimensionvalues.Thereareaseriesof
reportstructurekeywordsthatcanbeusedaswell.
InReportsetsthecontextatthereportorgrandtotallevel.Anyformulawiththese
keywordsforthecontextwillreturnanoveralltotal.Notethatthetotalmaystillbeaffected
byreportfilters.
InBlocksetsthecontextforeachblocksection.ForyearsIhavebeenwaitingforthis
settingtoberenamedtoreflecthowitreallyworks,butithasnt.Isupposeitsfor
backwardscompatibility.IfthereisonlyoneblockonareportthenInBlockandIn
Reportaregoingtobethesame.Butwhenablockisbrokenupintosections,thenthis
contextwillgenerateatotalforeachsectionvalue.ForthatreasonIsubmitthatabetter
namemighthavebeenInSectioninstead,butaslongasIknowwhatitdoesthespecific
worddoesnotreallymatter.
InBodyisthestandarddefaultcontextforeachrowofdata.
WithDesktopIntelligencewehavetheoptionofInCurrentPagewhichcanbequiteusefuland
unfortunatelynotyetavailableinWebIntelligence.
Finally,thesekeywordscanappearinseveralplacesinaformula.Themostcommonarethe
inputandoutputcontextsettings,butcertainfunctions(likeRunningSum()forexample)also
havearesetcontext.
Inputcontextisusedtodeterminetheinputvaluesfortheformula.
Outputcontextisusedtodeterminetheoutputscopeoftheformula.
Resetcontextisusedtodeterminewhenarunningfunctionstartsoveratzero.
Dimensionsreferencedintheinputcontextdonothavetoappearintheblock.Outputandreset
dimensionsmustappearintheblockinordertofunctioncorrectly.Formanycalculationsthe
defaultinputcontextworksjustfine.

Like

Tweet

Share

(1)Comment
ReadMore

Comments:
OneResponse
http://bobi.blog.com/2014/03/10/inforeachforallcontextoperatorinbo/

MonthlyTopics
SelectMonth

Calendar
March2014
M T W T F S S

1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
Feb

Apr

Pages
BetheMasterofinterview
70factsofUniverseDesigner!!
CreatingCascadingPromptsina
Universe
Dashboards
Dashboards
Datamodelling(DM)
Datawarehousesvsoperational
systems
DataWarehousingConcepts
SybaseASEVsSybaseIQ
SystemProcedures
Dr.Codd's12Rulesfora
2/6

You might also like