cancel
Showing results for 
Search instead for 
Did you mean: 

IF ELSEIF in advanced data action formula

0 Kudos

Dear All,

i am trying to achieve the following behavior:

if the month of November is not 0, then put 1 in December's value

else if the month of October is not 0, then put 2 in November and December's value

the code that i have written is the following (did not include the context):

IF RESULTLOOKUP([d/Date] = "201911") != 0 THEN

DATA([d/Date] = "201912") = 1

ELSEIF RESULTLOOKUP([d/Date] = "201910") != 0 THEN

DATA([d/Date] = "201911") = 2

DATA([d/Date] = "201912") = 2

ENDIF

what i am achieving through this code is that the second if statement is always executed regardless of the value of the month of November, so i am always getting "2" in the months of November and December

why is this behavior happening ? the ELSEIF statement should only be executed if the first if statement fails.

please advise if i have written the code in a wrong way.

thank you in advance

Regards,

View Entire Topic
0 Kudos

Dear Jamil,

Great question.

If you insert 1 statement before the first IF statement to: write or display actual values of 3 (for: October, November, & December)

What are the values of each?

Thanks

Sincerely,

joanna