Kscope19 - Essbase Deep Dive - Block Creation
Kscope19 - Essbase Deep Dive - 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
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
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
• 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.
Cons
• Can’t create blocks from scratch
@ALLOCATE and @MDALLOCATE
@ALLOCATE (amount, allocationRange,
basisMbr, [roundMbr],method [, methodParams]
[, round [, numDigits][, roundErr]])
https://kahoot.it/
How to get rid a block
• 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