Hey,
I am trying to have some logic which tries to check if the right value has been chosen in relation to another previous value.
From the attached documents you will see that there are a number of countries and each country may have 1 or more WPAs. What the logic in WPA_ID is trying to do is to check whether the WPA chosen is really matched with that particular country that was chosen earlier in the form. The logic is not working correctly, i am missing something kindly help.
I have attached my cspro docs and an excel sheet to help us understand it better.
IF statement Logic to check two values
IF statement Logic to check two values
- Attachments
-
- Coding CCPS.xlsx
- Country Coding with WPAs
- (10.09 KiB) Downloaded 308 times
-
- CCPS Survey.zip
- Survey
- (12.44 KiB) Downloaded 303 times
Re: IF statement Logic to check two values
Please try to replace
elseif country_id = 3 and $ <> 1 or $ <> 2 then
by
elseif country_id = 3 and !($ in 1,2) then
and
elseif country_id = 7 and $ <> 5 or $ <> 6 or $ <> 7 then
by
elseif country_id = 7 and !($ in 5:7) then
With these replacements, your syntax should work.
elseif country_id = 3 and $ <> 1 or $ <> 2 then
by
elseif country_id = 3 and !($ in 1,2) then
and
elseif country_id = 7 and $ <> 5 or $ <> 6 or $ <> 7 then
by
elseif country_id = 7 and !($ in 5:7) then
With these replacements, your syntax should work.