EPBCS – Improved Smart List Lookup in Calculations

Over the last month, I had to customize almost every feature in the EPBCS workforce planning application for a client. I have much to write about that experience but this one is my favorite. Do you want your Smart Lists to be dynamic but do not want to write long if/then statements for every possible value in the lists? Well, read on…..

When I first saw the feature to build a Smart List from metadata I started to get excited about the potential to use that in a calculation. After going through the Workforce app in detail I have seen the light. If you are not familiar with that module yet it basically has three plan types. The first two BSO cubes are for the plan and another one is for the rates. When you create a TBH it performs a lookup in the rate cube to get default values. Here is a simplified example of how the functionality works so you can use it in your applications as well.

I built a 2 database application one called FINPLAN and the other called RATES.

Here is the dimensionality of the two plan types.

FINPLAN

RATES

 

 

 

The idea is that a user can enter in information in the Finplan cube and the system will do a look up in the rate cube based on a region they have selected in the Smart List. Here is a quick preview of the form.

 

Creating the Smart List

Once the dimensionality is set up correctly you need to set up a Smart List that is based on your application metadata. I created a Smart List named REGIONS and configured it to point to the level 0 members of the regions dimension.

This creates a dynamic list based on the application metadata. Notice on the Entries tab the id for the members in the list. If you know the backend of planning this is the OBJECT_ID from the HSP_OBJECT table, planning is going to use this identifier in your calc scripts to identify the member in Essbase.

After the list is created I assign it to the account Opportunity_Region in the FINPLAN Cube.

RATES

I then built a web form against the RATES database to store the rates at the No Entity member and at the Regions.

I am just storing a monthly rate by region in this cube.

IN ACTION

Here is a quick view of it working:

CALCULATION

This is where the magic happens. Basically, we want to pull a value from the rate cube using the value assigned to the Smart List in the planning cube.

Here is the calculation:

Not as pretty version :

FIX (FY18,Plan,Working,USD,”No Entity”,@RELATIVE(“OPP”,0))
/*Define a variable to assign the Smart List value to*/
VAR SLVal;

/*Opportunity Overhead cost, lookup in Rate cube*/
“OVERHEAD_COST”(
/*Assign Smart List Value*/
SLVal=”OPP_REGION”->”BegBalance”;
IF( NOT (@ISMBR (“BegBalance”) ) ) /*Only Run on Months*/
IF( (SLVAL <> #MISSING) AND (“VOLUME”->”BegBalance” <>#MISSING)) /*Check if there is a Smart List Value and a volume*/
@XREF(_RATES_,”OVERHEAD_RATE”,”No Entity”,@CONCATENATE(“HSP_ID_”, @Name(@hspnumtostring(SLVal)))); /*apply Rate cube value*/
ENDIF
ENDIF

)

ENDFIX

THE MAGIC

If you look closer at the Xref formula you will notice@CONCATENATE(“HSP_ID_”, @Name(@hspnumtostring(SLVal))))

Lets break this down.

  • The SLVal was assigned from the Smart List value and it is populated with the OBJECT_ID of the member in PBCS.
  • The CDF hspnumtostring converts the numeric id to a string
  • The @Name function really makes sure its a string. Probably redundant.
  • Then its concatenated with “HSP_ID_”

Using the NY member as a value it would create a member that looks like this.

HSP_ID_50097

Behind the scenes Planning then can use that definition to translate it into a member that Essbase can read. I think with an alias table in Essbase.

Pretty cool!!

NOTES

The Xref formula uses txt values but if you need to convert this into an Essbase member then wrap the formula around an @MEMBER like this:

@MEMBER(@CONCATENATE(“HSP_ID_”, @Name(@hspnumtostring(SLVal)))))

 

You will only be able to use this in calculations and not in a fix statements since you need the data value of the Smart List to drive the formula. I tried to get it to work in a member formula and was not successful, but I only spent a few minutes on it.

CLOSING

This is a pretty nice enhancement that is a key to understand if you need to troubleshoot or enhance Workforce in EPBCS. Plus you can utilize it in your own applications to make your scripts and applications more dynamic and focused.

Here is the LCM if you need it.

12 thoughts on “EPBCS – Improved Smart List Lookup in Calculations

  1. Very nice example Anthony. This technique can even be used in On Premise. It just doesn’t have the easy way to populate the Smartlist with Members

    Like

  2. Hey Anthony, thanks for the well-explained write-up. It was exactly what I needed, I never would’ve been able to guess the right syntax for the XREF.

    Is this HSP_ID_* thing properly documented? I’ve seen similar tricks in other blogs, saying it was undocumented. What’s the point then in having dinamically populated smartlists if we’re missing the 2nd part of the equation?

    Again, many many thanks for this.

    Like

    1. Interesting question. The Smart list creation documented in the blog is a feature of the software and that is well documented. The XREF is from rules that Oracle is releasing as part of EPBCS. So while they may not be documented this is coming from code released from Oracle and code that they support. I feel fairly comfortable about using it, but ultimately its up to you.

      Like

  3. Thank you Anthony, its really helpful. but can you tell me how to take smart list member name instead of object ID. i have to use smart list member to store data. here smart list member is the member of other dimension.

    Like

  4. Thanks Anthony for sharing this information. A client uses HP 11.1.2.4 on premise and we are attempting to use the formula above to incorporate a member that is selectable in a smart list to map it to the actual member. For example we would like account 100, available on a smart list to be mapped to the actual account 100 in the accounts hierarchy. Because we are on-premise I don’t think we are able to use the HSP_ID however we are trying to use the @hspnumstring to pull the Smartlist ID, which is identical to the account number in our calculation.

    What we have come up with is the following:

    @Xwrite(“100”,@loopback,@hspnumtostring(Select_Subsidiary));

    Select_Subsidiary being the smartlist. For testing purposes we have selected smart list ID 200.

    When we run this calculation it fails and we always receive the following message:

    Error executing formula for [Base] (line 18): invalid member name [-2147483648] in function [@_XWRITE]

    Also regardless of what smart list ID we put in into the xwrite function we always encounter the invalid member name [-2147483648].

    Would you have happened to see this in the past and know how to handle this in an on prem environment?

    Thank you.

    Like

    1. Unfortunately your method will not work because essbase stores the ObjectID and not the actual member name. Check your outline on-prem, does it have an alias table that has the HSP_ format?

      Like

      1. Hi Anthony,

        Thanks for getting back to me so quickly. I checked the alias tables available in easconsole in the outline under the properties tab and the only one that I see is the Default table.

        Do you know of another way we could possible work around to this?

        Thanks so much for your help.

        Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s