Skip to Content

Calculation View Query

Hello, i have a question. At calculation view level i have 2 analytic views. Both views have 2 different fields lets say first one has FieldA and second analytic view has Field B. What i want to do is create another field and see which ever field is populated, take that value and then populate my new fieldC. Is it possible to do in HANA?

Thanks.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Apr 06, 2016 at 02:02 AM

    Hello Sunil,

    Join the two analytic view fields(each from separate projections P1 and P2) in a third projection P3. In P3, create a 'calculated column' Field C with the following expression,

    IF(Isnull(FieldA),FieldB, FieldA)

    You can find the details of the these expressions and functions in HANA SQL help.

    Try this, read the help document and let us know if you run into errors or need more help.

    Benedict

    Add comment
    10|10000 characters needed characters exceeded

    • True. But the OP never mentioned how he wanted to proceed when both fields are empty😕

      We can nest the IF statement to create a IF..ELSE block if a third field is involved,

      FieldD = IF(Isnull(FieldA),(IF(Isnull(FieldB),FieldC,FieldB),FieldA )😎

  • Apr 06, 2016 at 01:17 AM

    Hi,

    Can you post a sample data?

    Regards,

    Loed

    Add comment
    10|10000 characters needed characters exceeded