on 2023 Apr 26 8:51 AM
Hi All,
please help me with the KF Expression for below mentioned calcualtion.
IF A is Number AND B is >0 then we use C-D other wise it should be "0".
Like if(number(A),B>0,C-D,0). what function do i need use to find if it is number in KF "A".
Hello KUMAR R,
there is one thing to keep in mind in creating this calculation. If A is null, Praveen's example calculation will return a null value. Any calculation will return a null value regardless of how it is written, if any key figure in the calculation is null and the calculation doesn't have an ISNULL check. This is mentioned in the Help portal link Praveen provided. This is because null isn't a value that you can compare in an expression (i.e. NULL > 0, NULL = 4, etc).
So in regards to A, if it isn't a number, what else can it be?
Another way to write Praveen's example is: IF(ISNULL("A"), 0, IF( ("A"**2 > 0) AND ("B" > 0), "C" - "D", 0))
Regards,
Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi reddyatoz,
For Commonly used functions and expressions, refer SAP IBP help: Commonly Used Functions and Expressions | SAP Help Portal.
For your case one of the ways, you can write the KF logic is: IF( ("A"**2 > 0) AND ("B" >0) , "C" - "D" , 0)
So, if "A" is really a number, then square will always be greater than 0. Else it will throw 0.
Regards,
Praveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
3 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.