Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
bsbernabe
Creator

Expression If statement

Hello There,

     Can you help me/teach me how to formulate or how to use If in expression like below scenario? i need the value or formula like below list.

  B1    |   RB2   |   RB3

Close  |   Close  |  Close

Blank  |   Blank  |  Close

Open  |  Close   |  Pending  

Cause as of now only i have like below screenshot i don't know how to formulate for the column RB3 to get the value using if.

i try this for the Column(RB3) but i know its wrong

  If ((B1) = Close) and If ((RB2) = Close) then RB3 = Close

      If ((B1) = Blank) and If ((RB2) = Blank) then RB3 = Close

      If ((B1) = Open) and If ((RB2) = Close) then RB3 = Pending

so what should i do?

Regards,

Bing

1 Solution

Accepted Solutions
ahmar811
Creator III

Hi

Bing


put this expression into column 3(RB3)

=if(B1='Close' and RB2='Close','Close',

if(B1=Null() and RB2=Null(),'Close',

if(B1='Open' and RB2='Close','Pending')))



Regards

Ahmar


View solution in original post

9 Replies
ahmar811
Creator III

Hi

Bing


put this expression into column 3(RB3)

=if(B1='Close' and RB2='Close','Close',

if(B1=Null() and RB2=Null(),'Close',

if(B1='Open' and RB2='Close','Pending')))



Regards

Ahmar


bsbernabe
Creator
Author

Hi Ahmar,

     Thank you so much for your time and fast support i really appreciate some formula is working but except in terms of NULL not working like below expression:

if([RB1]=Null() and [RB2]=Null(),'Close',

if([RB1]='Open' and [RB2]=Null(),'Pending')

if i use this the value of column RB3 is blank, i hope you support me in this part

Best Regards,

Bing

ahmar811
Creator III

Hi

Bing

Please find updated expression below I hope this will work for if it is not working please send me sample qvw file.

if((RB1=Null() or RB1='' or RB1=' ') and (RB2=Null() or RB2='' or RB2=' '),'Close',

if([RB1]='Open' and (RB2=Null() or RB2='' or RB2=' '),'Pending')

Regards

Ahmar

effinty2112
Master

Hi Bing,

Your logic boils down to if B1 ='Open' then RB3 = 'Pending'

B1 RB2 if(B1 = 'Open', 'Pending','Close')
CloseCloseClose
OpenClosePending
Close

cheers

Andrew

bsbernabe
Creator
Author

Hello Ahmar,


Here my sample QVW, Kindly see the attached file.


Best Regards,

Bing

sunny_talwar

What is wrong with the output you are getting?

bsbernabe
Creator
Author

Hi Sunny,

Regarding the expression Ahmar share to me i really appreciate cause it is almost good except the Null part cause i try to use the expression


"if([RB1]='Open' and [RB2]=Null(), suppose to be 'Pending',"


but not working so i ask Him a favor to help me in that part you also can try to check my  QVW Test attached file in my previous reply, you can see at Column RB3 NULL is not working.


Regards

Bing

Anil_Babu_Samineni

In synthetically or functional wise the Null() function won't work as expected if you have dashed or spaces or any special characters

I would ask you to do something like this

If(RB1='Open' , If(RB2=' ', 'Pending',"))


Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
balar025
Creator III

Hi,

You can use below thing instead of if condition

Set NullInterpret = '';

Status:

Mapping Load * Inline

[

Logic,Status

Open|Close,Pending

Close|Close,Close

Close|Open,Pending

|,

];

Load

*,

ApplyMap('Status',B1&'|'&B2) as RB3;

Load * Inline

[

B1,B2

Open,Close

Close,Close

,

Close,Open

];

-Ravi Balar