Skip to Content
0

How to put IF and Else logic in HANA graphical Views

May 16, 2017 at 08:13 AM

294

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Florian Pfeffer
May 17, 2017 at 10:35 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Fernando Da Ros
May 18, 2017 at 11:17 PM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

thank you, really helps.

0