cancel
Showing results for 
Search instead for 
Did you mean: 

Nested if in Calculated Column - Graphical Calc View

Former Member
0 Kudos

Hi All,

I have a nested condition )case with in if as below) that I want to do it in a calculated column, I am not sure how else it can be done, any ideas? the case statement does not work for this scenario.

nested If below

    IF AREA IS INITIAL.

        CASE QUESTION.

                    WHEN '0001'.

                        bukrs = "SSS".

                  WHEN '0002'.

                        bukrs = "PPP".

                  WHEN '0003'.

                        bukrs = "QQQ".

                  WHEN '0004'.

                        bukrs = "TTT".

                  WHEN '0005'.

                        bukrs = "RRR".

        ENDCASE.

    ELSE.

         bukrs = AREA

    ENDIF.

And my Hana condition column is as below

if(isNull("AREA") or "AREA" = ' ',

if("QUESTION = '0001','SSS',

  (if("QUESTION" = '0002','PPP',

  (if("QUESTION" = '0003','QQQ',

  (if("QUESTION" = '0004','TTT',

  (if("QUESTION"='0005','RRR',"AREA"))

      ))

    ))

   ))

  ) ,"AREA" )

Thanks,

Arthur.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member182302
Active Contributor
0 Kudos

Hi Arthur,

What is the problem, is the IF statement you defined in HANA is not working as expected?

Regards,

Krishna Tangudu

Former Member
0 Kudos

It does not seem to work as the ABAP code works. Is it matching? because when we defined If, it has to have else part as well n Hana, but in ABAP we could skip that.

Former Member
0 Kudos

Krishna,

Thank you for looking at it. Please ignore this link. I found an issue and it is not related to do with this piece of code and I am closing this.

Thank you,

Arthur.