cancel
Showing results for 
Search instead for 
Did you mean: 

Graphical mapping IF then else not working

Former Member
0 Kudos

IF C2_INPUT Exits then C2_INPUT eq C2_Output

else

C1_INPUT--JDBCLOOKUP = C2_Output

I am doing a graphical mapping and its working when C2_INPUT value is not null .If C2_INPUT value is blank then

I will take C1_INPUT and do a JDBC lookup and populate C2_OUTPUT.

we need to populate C2_OUTPUT based on C2_INPUT .

I did a Display Q and the value for C2_output is null whenever the expression fails (C2_INPUT is blank)

Here is my srcuture

INPUT ITEM OUTPUT ITEM

C1_INPUT <.> C1_OUTPUT

C2_INPUT C2_OUTPUT(graphical mapping).

I am on PI 7.0

Any thoughts are helpful and rewarded !

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Kumar,

Use a simple if else without exists function should work for you. Because when you use if condition it automatically checks for exists only. So you dont need to do exists check. Try out and let us know.

Regards,

---Satish

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks Folks before the post I was using boolean function instead of EqualsS and was stuck with syntax error " Cannot cast to boolean (since only True or Flase is expected)"

Former Member
0 Kudos

As correctly said by Sandeep.. but just a small correction to his solution.. use the NOT function after equalS function.. e.g.

C2_INPUT ------------------->| 
                              equalsS ----->NOT--->IF --->THEN ---->C2_INPUT
Blank Constant(' ')--------->|                                   


ELSE ---->C1_INPUT

Regards,

Sarvesh

former_member208856
Active Contributor
0 Kudos

When you are checking C2_INPUT using exists, it can be a problem here.

In place of EXISTS function

use C2_INPUT --> NOT (Boolean Function) --> EqualsS (For text compare) or EqualsA (For Arthematic Compare) -->

In second part of Equal pass Constant Value ' '

CONSTANT ' ' (pass only space in that).

I hope it will work.