cancel
Showing results for 
Search instead for 
Did you mean: 

HANA Modelling (If condition issue)

vaibhav_rathore
Participant
0 Kudos

Hi All,


1) if (  Action_Date = Expiry_Date and ( "Status"!='Closed' or "Status"!='Confirmed' or"Status"!='Withdrawn' or "Status"!='Solved' ) , 'About to Breach','')

Status:

Closed

Confirmed

Withdrawn

Solved


I want the above condition to be working even if there is one of them are present or all of them are present.

if i am using OR in this i am getting the 'About to Breach' status even for status which are equal to the

Closed

Confirmed

Withdrawn

Solved

and when i am using AND then it is working fine.

2) if (  Action_Date < Expiry_Date and ( "Status"='Closed' or "Status"='Confirmed' or"Status"='Withdrawn' or "Status"='Solved' ) , 'Solved','')


where using OR in the above condition is working fine for 'Equal to' and i am using AND in this then it giving wrong result.


What i want is even if any of the Status is present or all of them are present then both the conditions must work fine.

So i should use AND or OR if i want all as well as even if one of them are present then the condition must work.

Regards

Vaibhav

Accepted Solutions (0)

Answers (2)

Answers (2)

muthuram_shanmugavel2
Contributor
0 Kudos

Hi Vaibhav,

//1) if (  Action_Date = Expiry_Date and ( "Status"!='Closed' or "Status"!='Confirmed' or"Status"!='Withdrawn' or "Status"!='Solved' ) , 'About to Breach','')//

For this If Condition,

Use this Logic below, you will get required output.

IF ("ACTION_DATE" = "EXPIRY_DATE", IF ( "STATUS"='Closed' OR "STATUS"='Withdrawn' OR "STATUS"='Solved' OR "STATUS"='Confirmed', '', 'About To Breach'), '')



1. First IF Condition, It will check If ACTION_DATE = EXPIRY_DATE.

2. If YES, Then It will check Status by 2nd IF Condition.

    (In Second If Condition, 'About To Breach' is written in else statement)

    If Status NOT IN (Closed, Withdrawn, Solved, Confirmed), It will display 'About To Breach'

 



I hope it will resolve your issue.


Regards,

Muthuram


vaibhav_rathore
Participant
0 Kudos

Hi,

Thanks for the reply.

I tried with the given logic also.

But it is not working,it is only working with condition as below:

if(Action_date=Expiry_date and ("Status"!='Confirmed' and "Status"!='Closed' and "Status"!='Withdrawn'),'About to Breach',' ')

where as for Solved condition it is working with:

if (  Action_Date < Expiry_Date and ( "Status"='Closed' or "Status"='Confirmed' or"Status"='Withdrawn' or "Status"='Solved' ) , 'Solved','')



you suggestion please.

Regards

Vaibhav

muthuram_shanmugavel2
Contributor
0 Kudos

Hi Vaibhav,

Have you tried this?. It should work.

IF ("ACTION_DATE" = "EXPIRY_DATE", IF ( "STATUS"='Closed' OR "STATUS"='Withdrawn'OR "STATUS"='Solved' OR "STATUS"='Confirmed', '', 'About To Breach'), '')


Your requirement is, When ACTION_DATE = EXPIRY_DATE,

If Status NOT IN (Closed, Confirmed, Withdrawn, Solved),

It should display "About To Breach". right?

Regards,

Muthuram

former_member182302
Active Contributor
0 Kudos

Not completely sure on what you were trying to do, but you cannot use AND or OR for both the columns, As you mentioned you need to use AND for one formula and for another OR. What is the issue in using 2 calculated columns?

May be you can help me understand it better

Regards,

Krishna Tangudu

SergioG_TX
Active Contributor
0 Kudos

Vaibhav,

1) you can have :

if ( Action_Date = Expiry_Date AND ("Status" = 'Closed' or "Status" = 'Confirmed' or "Status" = 'Solved' or "Status" = 'Withdrawn'), 'About to Breach', '' )

-- the or condition ensures at least one of all those status is present

-- notice the Action_Date = Expiry_Date condition.. please make sure this what you need also

2)  I don't understand your 2nd condition.

I see you are trying to test whether or not your Status is Solved by checking if the Actoin_Date < (less than) Expiry_date and also the status is any of the ones listed... correct?