if statement in WNL

Hi,

I have some problem about writing an if statement in WNL.

There are two columns 1 and 2 (c1 and c2). I want to add a new column 3 (c3), if the c1 value is empty, then the value of c3 is also empty, otherwise, the value of c3 equals to that of c2.

I tried if(c1=“NULL”,“NULL”,c2) but the result is that C3=C2, no empty cells.

How to write the if statement? Would someone help me? Thank you!

LLLi

Dear LLLi, the way if worls in winnonlion or NLME is as follws:

Suppose you want to say that if the time is less than 2, then define A1=100, else A1=10

? stands for then and : stands for else

A1 is the variable that is subject to the condition and is at the left side of the if condition

A1=(t<2?100:10)

means A1 is equal t0 100 if the time is less than 2 and if not it is equal to 10.

I think you wanted to add something in your message

Best

Serge

Dear Serge,

Thank you for your reply. My first post may be a little confusing. Please see more detail below.

Before the descriptive stats, I have to exclude some cells from column 2 using Data Wizard–>transformation–>custom. The excluding rule is that for each subject, when the c1 value is empty, the c3 is also empty, otherwise the c3 value equals to c2 value.

I can understand your statement above but it can be used in the Data Wizard as well?

I also tried if(c1=0,“NULL”,c2) but the result is still C3=C2, no empty cells.

This if statement works in Excel. The C3 is NULL when C1 is empty.

The if statement in excel is different from that in WNL?

Thank you!

LLLi

I haven’t got Phoenix open in front of me but I think you need to be looking at IsNull, see;

https://support.certara.com/forums/topic/658-operator-andor-not-working-in-column-transformation-phx13/?p=2669

at the moment you are asking if C1 is ‘NULL’ and that is exactly what it is searching for; a text string of ‘NULL’.

Hope everyone has a good weekend, Simon

Hi Simon,

Thank you for your reply. I used IsNull first and then used the if statement. It worked!

I have another question about non-parametric comparison of Tmax for parallel study. Would you please take a look at my post here (https://support.certara.com/forums/topic/902-non-parametric-analysis-of-tmax-in-a-2-treatment-2-period-single-sequence-study/).

Thank you!

LLLi