Skip to Content
author's profile photo Former Member
Former Member

Calculated column

Hi All,

I am facing a problem how to create a calculated column in which i can use if and else condition??


Example:
I have few names like X,Y,Z and their corresponding salary 10000,20000 & 30000.
I have to create a new calculated column so that X new salary will be double and Y salary would be thrice and so on.
Please any one suggest me solution.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on May 21, 2013 at 08:11 PM

    You can create an Attribute View and then a calculated column like this...

    case("NAME",'X',"SALARY" * 2,'Y',"SALARY" * 3,"SALARY")

    Meaning that for the field "NAME" when it's value is 'X' you will have the Salary multiplied by 2, when the value is 'Y' you will have the Salary multiplied by 3...otherwise...you will get the Salary ๐Ÿ˜‰

    Greetings,

    Blag.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 21, 2013 at 09:40 PM

    Hi Vikram,

    I guess your use case for HR seems not to be simple.

    Anyhow, take a look on decision tables, there's a option to you query it and other to you update the values:

    http://scn.sap.com/community/developer-center/hana/blog/2013/01/11/what-can-you-do-with-decision-tables-in-sap-hana-sp05

    Regards, Fernando Da Rรณs

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.