Skip to Content
Technical Articles
Author's profile photo Dhyaneshwaran KS

Handling implication of Unbooked data in Analytic Application script (Analytic Model)

Hello All,

As we all know, SAC can be used for analytic as well as planning use cases but ever so slightly favoring BPC/ Planning. Hence the existence of options allowing us to manually create custom hierarchies in blank models, concept of ‘Account’ dimension and supplementing options such as enabling / disabling ‘Un-booked Data’.

What is Unbooked data?:  Un-booked data simply means there is no corresponding transactional data for the concerned field .

Now, what is interesting is that the unbooked data resides in the model and even ‘Delete Facts’ and reloading wont make them go away! This can easily be avoided / ignored by toggling the ‘Show Unbooked data’ while designing the table (option shown in below screenshot) but while dealing with scripting this is not the case.

Why does it exist and its importance: The option to show the unbooked data of an ‘Account’ dimension is particularly helpful in creating planning related calculations even if they do not carry any transaction / facts at present.

But what if is becomes undesirable in an dashboard on top of a Analytic model?

Where is the Caveat?: This would present an interesting situation while scripting for an analytic application on top of an Analytic model. Let us take an hypothetical example of designing a simple drop down. Here, I am designing a user selection for the motorcycle brand. Let’s assume the below values for Brand (notice that it contains 2 unbooked data values).

  1. Ducati
  2. Husqvarna
  3. Honda (Unbooked Member)
  4. Triumph
  5. Indian (Unbooked Member)
  6. Royal Enfield

I have designed a drop down using the below code which populates the list of values:

var Brand_list = Table_DropDown.getDataSource().getMembers(“Brand”);

for (var i=0;i< Brand_list.length; i++)

{

DD_Brand.addItem(Brand_list[i].id,Brand_list[i].description);

}

DD_Brand.removeItem(“#”);

But what if ‘Honda’ and ‘Indian’ values exist in your DEV database (mockup or test data) but not in PROD database. In such a case, the migrated report will still show up these 2 value in the drop down in PROD. The getDataSource does not seem to let go of the unbooked members. Rightly so in a ‘Planning’ world since you might be needing it for scripting in such a case bit not so much in an ‘Analytic model’ world.

Solution: Manually remove the 2 values. The script is tweaked as below

for (var i=0;i< Brand_list.length; i++){

if(Brand_list[i].id !==”Honda”&& Brand_list[i].id !==”Indian”)

{

DD_Brand.addItem(Brand_list[i].id,Brand_list[i].description);

}

}

DD_Brand.removeItem(“#”);

Hope you find this post useful in case you observe similar scenario in your projects. Let me know your comments and if you have found a better resolution for such a scenario.

 

Regards,

Dhyanesh

 

Assigned tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.