Erlang B Calculation

Hi Guys,

I trying to find someway to calculate Erlang B(it`s formula to traffic capacity based on number of available lines and GOS).
I looked in google and find that formula is:

Function ErlangB (E as Double, m As Integer) As Double
Dim InvB As Double
Dim j As Integer

InvB = 1.0
For j = 1 To m
InvB = 1.0 + j / E * InvB
Next j
ErlangB = 1.0 / InvB
End Function

If someone familiar with that? How it could be implemented in webi report?

Big Thanks


Parahall :south_africa: (BOB member since 2010-12-20)

Implement this function in your database and invoke this function from within an Universe object and use that object in the report.


jprasanthram :switzerland: (BOB member since 2010-12-10)

jprasanthram is correct, if you want an actual ‘function’ you need to use the database.

However, if all your data that fills the function is part of your dataset in the WEBI microcube, then you should be able to calculate it using extensive use of the FOR EACH and FOR ALL Functions within WEBI. Those help WEBI calculate things regardless of row position. WHERE might also come in handy.

Without knowing the specicifics of your dataset and what your variables are it’d be hard to give you an example formula to work with.


JPetlev (BOB member since 2006-11-01)

Yeah,
I already implement this formula as function in DB, but problem that “number of lines” that used in calculation is input from user in report…
And i can`t find anyway to put this value from report in my to_capacity() funciton in db


Parahall :south_africa: (BOB member since 2010-12-20)

Hi,

Create a new object (either dimension or measure - what makes sense) using the function that you created. Then in the function parameters, you can use @prompt() syntax to “ask” report user for the value of the function parameter.


Marek Chladny :slovakia: (BOB member since 2003-11-27)

Marek,
thanks for answer

you mean object in universe?or object in report himself?


Parahall :south_africa: (BOB member since 2010-12-20)

Hi,

I meant an object in a BO universe.


Marek Chladny :slovakia: (BOB member since 2003-11-27)

Sorry i`m newbie with Universe building.
Universe was builded by someone else.
Could you tell me how exactly object should be created?

in db i use it in such way…
select to_capacityg(30) from dual

and i work on couple table with join between them.

big thanks.


Parahall :south_africa: (BOB member since 2010-12-20)

Hi,

The original ErlangB function in your first post has 2 parameters. The function in your last post has only one. Maybe I am missing something? Or the second function is a custom function?

Generally, an object in a universe that uses a function as well as a prompt, should be defined as follows (the pseudo-syntax is for Oracle, so replace parts where needed):

schema_name.package_name.function_name(parameter1, parameter2, ...)

where parameterN can be a table.column or a prompt defined as

@prompt('select value','N' or 'A',{list of values},mono,free/constrained)

Marek Chladny :slovakia: (BOB member since 2003-11-27)

Yeah. You right about number of parameters for Erlang b. but in my system the second parameter is constant so i elimanate it.

So back to issue,
seems that i miss something.
I put the following in “select” of object that i create:
psa.to_capacityg(@Prompt(‘Enter number of connected lines’,‘N’,mono,free))

when i try to parse it i recieve the following error: “Parse failed: Exception: DBD, ORO-00903: Invalid table name. State: N/A”

but the following query: select psa.to_capacityg(N) from dual" execute properly…

“psa” its name of schema where function exist. and there is no package name... (its not allowed to put in sql select psa.capacityg(n) from psa.to_capacityg…
I`m lost…
db-error.jpg


Parahall :south_africa: (BOB member since 2010-12-20)

Hi,

It looks OK.

That’s fine. The parsing error you got is because the object does not reference any table in the universe structure. However, when you use the object along with any other “normal” universe object, the query will execute just fine. Try it and let us know how it went.


Marek Chladny :slovakia: (BOB member since 2003-11-27)