A Deep Dive into Block Creation
What is 1 + 1 in
Essbase?
#missing
Belen Ortiz – Worldpay – [email protected]
Peter Nitschke – Pivot2 Solutions - [email protected]
Tim German – Qubix – [email protected]
Gary Crisci – GE – [email protected]
A Quick Essbase History Lesson
• Essbase has existed for almost 30 years
• Originally intended to deal with scalability problems of excel
(and lotus 1-2-3!) Remembering that pivot tables weren’t in
heavy use until 95 – this was somewhat ground-breaking
• Intention was to deal with the problem of ‘data explosion’ –
• Not every intersection is valid
• Store and calculate only valid intersections
• Use the data to define what is valid
• Reuse all calculations (business logic) against every other dimension
So what’s a block again?
• A cube is a collection of dimensions
• Each dimension is either Dense or Sparse
• Dense dimensions combine to form a block
• Therefore there must be at least 1 dense dimension!
• Sparse members are then index entries that point to that block
• Data blocks only exist for valid sparse intersections
This is how Essbase databases stay
a manageable size
BSO Block Example
Quiz:
1) What is the maximum number of
blocks possible?
2) What is the dense cell count?
3) What is the block size in bytes
BSO Block Example
Quiz:
What is the maximum number of blocks possible?
4 Blocks! (yes, this is a small cube!)
Company1FY10
Company1FY11
Company2FY10
This is the data block – defined by Accounts and Periods
What is the Cell count?
6 Stored accounts * 12 Stored periods = 72 cells
What is the block size? Company1FY11
6 Stored Accounts * 12 Stored Periods * 8 bytes = 576
Bytes
So what is a block creation issue?
• Let’s add some functionality to our basic cube.
• A new dense dimension called Measure to enter movements and calculate opening and closing balances
Great so far….
• Okay, so this works for the year….but what about the year end rollover? We can’t just go back a period for Jan.
• Extending the function a little, run a quick rule and….
I’ve seen that before….
• So what is the deal here?
• Basically the FY11->Company 1 block does NOT exist when the calculation is run
• A dense formula will not create a new block by itself
Let’s play a game Clarice
https://kahoot.it/
So How do I Fix it? – Part 1
• Well – the easiest option is just submitting a value into the dense block – that will create it and then any calculations will work
• I’m submitting a number to the Opening_Balance->Jan->FY11 (because that makes sense)
• Rerunning the rule annnnd….
So How do I Fix it? – Part 2
• But – submitting a value to any of the blue cells would work – it’s all the same block!
So How do I Fix it? – Part 3!
• It also doesn’t need to be the same account – that’s also a dense dimension – nor does it have to be a level 0 member.
• Here I am loading to Account - the top level dimension member
• Make sure you’re loading to a stored member – dynamic calcs don’t work!
• Obviously this is a bad design – upper level dense members should be dynamic calc - but it’s a 5 dimension cube and Thurs at
Kscope, cut me some slack!
Okay – so manually submitting data. Got it.
• No!
• There are plenty of ways to solve this without having to manually submit data!
• Easy!
By default, Essbase applies dense-member formulas only to existing data blocks. SET CREATENONMISSINGBLK ON enables
Essbase to create potential blocks in memory where the dense-member formulas are performed. Of these potential blocks, Essbase
writes to the database only blocks that contain values; blocks resulting in only #MISSING are not written to the database.
• Okay. So please don’t ever do this. For a 4 block cube it won’t matter, for a cube for 40 million it might never come back.
• The reason to ‘not’ do it is because it’s really realllly realllllly slow. Basically it has to check every possible intersection to see if it
resolves to a value, and then assign it.
• Not only is it slow to run, it then also risks creating a heap of redundant intersections
• It’s a much better if you can heavily use fixes to restrict the sparse intersections
Fine, not manually submitting, not Createnonmissing
• Let’s look at some other options:
Pros
• Datacopy is a fast, simple and reasonably brutal mechanism to ‘fix’ block creation
• Blocks from the source (FY10) are copied to target (FY11) where they exist
• By fixing on Opening and Closing members (which have formulas) they should be replaced by the Calc All
Cons
• You basically have to hardcode the source and target
• It ‘creates’ data that is invalid – this will need to be cleared
• It also risks clearing and NOT clearing target data
What about @CREATEBLOCK?
• So this is a ‘new’ (circa 11.1.2.3!) function
Pros
• Basically creates blocks across a sparse dimension
• Nice because it won’t overwrite data, just creates blocks as needed
• Can create blocks without a starter block (or on an empty cube)
Cons
• Kinda fiddly
• Requires a sparse member to create blocks from scratch
• Could create more blocks than you potentially need
Sparse Assignment – The Mother of All Switcheroos
•When in doubt, switch it out”
•In this example account is dense, scenario and version are sparse.
•Pick a sparse dimension member that applies to your whole equation. Just one! Think POV.
•The usual suspects are usually scenario and version.
•Switch the dense member on the left side of the equal for your sparse one.
•Adjust your equation to reflect the changes in your FIX (may need to add cross dims).
Cons
•Slow-ish.
•Code may look unintuitive – help “the future you” and comment your code!
Sparse Assignment – Rolling in the deep.
• Sparse assignments can also be ‘Dynamic’
• This creates blocks from blocks that exist - @CURRMBR Year creates the @NEXTSIBLING Year
• Very similar to @CREATEBLOCK on dense
Pros
• Really fast
• Generally creates blocks across the dimensions that you need blocks
• Doesn’t over-generate blocks
Cons
• Can’t create blocks from scratch
@ALLOCATE and @MDALLOCATE
@ALLOCATE (amount, allocationRange,
basisMbr, [roundMbr],method [, methodParams]
[, round [, numDigits][, roundErr]])
• Created the target blocks in the allocation range automatically
• @MDALLOCATE does the same thing, but multidimensionally
• Do use this when actually performing an allocation
• Don't use this to create blocks otherwise (it can work, but is
confusing and other methods make more sense)
Block Creation Visualised!
Let’s play a game Clarice
https://kahoot.it/
How to get rid a block
Okay so…..the documentation is wrong. I know, we’re as shocked as you…
• Assign a value of #missing and wait for a dense structure
• Use a sparse ClearData without a dense fix
• Use a Clearblock without a dense fix
• Export \ Import the data (with a clear \ reset in the middle)
The weird ones…
@XWRITE(1,@LoopBack,"Account");
• XWRITE creates values, by assigning a static value wrapped in @LOOPBACK you can create a block
• This can be even put in a dynamic calc member and used to create a block dynamically
Dynamic Calc and Store
• A use case for Dynamic Calc and Store!
• Even with a formula of #missing – querying the member creates a block!
• You can create blocks, from smartview, without having write access to the cube!
Block Removal Visualised!