Hello ,
I am trying to convert a Scripted Calculation view to Graphical one.
Scripted one has a logic depending on the input parameter to execute a block of view/sql
Say .. If parameter has been passed. I check this my length of parameter. If more than Zero is Yes and IF ZERO is no.
{
yes block
}
else
{
No Block.
}
How can i achieve the same in CA graphical view.
Thanks in Advance.
Regards
Srikanth
The solution depends on what your logic is in the blocks.
For easy cases maybe the replacement can be done using calculated columns, for complex cases which cannot be realized in a graphical way, maybe a table function is necessary (in which you can do the same SQLScript logic) which is used as data source in a projection node of the graphical calc. view.
Regards,
Florian
Hi Srikanth,
As Florian mentioned the answer depends on your scenario, which is not exposed on your request.
Adding another solution with a different approach you can create two projections and later union it to prepare the output.
On each projection you put an expression as filter like:
projection source 1 expression: strlen( p_parameter) = 0
projection source 2 expression: strlen( p_parameter) > 0
The "magic" will happen on instantiation of view which will prune the false constant and execute only the true expression.
Hope this helps.
Regards, Fernando Da Rós
thank you, really helps.