Thursday, January 19, 2017

Last Saved By in PBCS and Hyperion Planning On Premise

I got the idea about this post during my long run, what is really nice about running long distances is the pain you feel while running, the joy, and euphoria when you are done, you also have a lot of time to think about anything to distract yourself from thinking about the 15 Kms remaining...


Who changed the numbers? :@



We always hear that question right?, I want to show how to do it in PBCS (now a standard functionality) and  Planning On Premise (workaround).


PBCS

This is how you get it in PBCS:

In Calculation Manager create a variable of type "StringAsNumber", select "Use System Defaults" and you'll get the User Name as default value,



You include it in your script just like any other variable, only you can now assign it to a member of type "Text" with getting the famous error "Expected number found string,,,"




Create a sample form, include the business and make it run on save. So my form as shown below has nothing in it


And after I entered some data and saved the form.





That's it, pretty simple and convenient, gotta love PBCS right?


Hyperion Planning On Premise:


Before I start, whatever I'm doing here is just for fun, you don't have to take it seriously. For demonstration purposes I hard coded my form name because I was lazy.


So now I want to show how to do the same in On Premise Planning plus one more tweak, I will add the Last Saved time in a readable format.

In a nutshell, I'm going to do the following :

1. Enable application auditing
2. On save update a custom table with the latest user who saved the form and the time it was saved
3. Run a Groovy script to load the text data using OutlineLoad planning utility


Pretty simple logic, I did struggle in using one of the CDFs thanks to Calculation Manager's excellent, heavenly like documentation!!!


This is my data form before I do anything.





And my business rule:




So what is happening up there???

I'm using the CDF @CalcMgrDBUpdate to update a custom table with the last user who saved the form/and time from Planning table HSP_AUDIT_RECORDS, the update query is no where near perfection but it works fine for my demonstration purposes, I'm getting the last user/time using Oracle timestamps.


After @CalcMgrDBUpdate is executed I'll get the following in the table.





The columns "Last Saved By" and "Last Saved" are my two Account text member I'm going to load.









Finally I'll run my Groovy script to simply load the text data into Hyperion Planning using OutlineLoad utility and that's it.





So back to the form, I'm logging with the user Guardiola and I'm going to delete the figures in January.




And after saving the form, I got the user and the time the form was saved. (Nice huh? )





Now I'll login with MontyPython user, and change the figures in February.







And after saving the form.....







And my log just in case...





Voila! that's it for today, and yes it is working perfectly!


Hope you had fun reading this.






May the Cosmos Be With You!

2 comments:

  1. Hi Omar,
    Thanks for the post.
    I am running into the below issue

    Unable to obtain dimension information and/or perform a data load: no HspEssbaseEnv in java.library.path
    [Tue Dec 18 23:57:42 PST 2018]Trace information: java.lang.ClassLoader::loadLibrary:1738, java.lang.Runtime::loadLibrary0:823, java.lang.System::loadLibrary:1028, com.hyperion.planning.olap.HspEssbaseEnv:::34, com.hyperion.planning.olap.HspEssbaseJniOlap:::127, com.hyperion.planning.HspJSImpl::createOLAP:509, com.hyperion.planning.HspJSImpl:::177, com.hyperion.planning.HspJSHomeImpl::createHspJS:662, com.hyperion.planning.HspJSHomeImpl::getHspJSByApp:425, com.hyperion.planning.HspJSHomeImpl::getHspJSByApp:399, com.hyperion.planning.HyperionPlanningBean::login:746, com.hyperion.planning.HyperionPlanningBean::Login:628, com.hyperion.planning.HyperionPlanningBean::Login:758, com.hyperion.planning.utils.HspOutlineLoad::login:4036, com.hyperion.planning.utils.HspOutlineLoad::loginIfRequired:357, com.hyperion.planning.utils.HspOutlineLoad::loadAndPrintStatus:5435, com.hyperion.planning.utils.HspOutlineLoad::main:4836
    Planning Outline data store load process finished: no input records were read due to an empty file or table, or not all input records were read due to errors. 0 data records were read, 0 data records were processed, 0 were accepted for loading (verify actual load with Essbase log files), 0 were rejected.

    ReplyDelete