Writing an If statement with multiple OR and AND
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi, i need help to reconstruct this if-else logic. I'm not getting the correct result. Appreciate your advice.
Thanks in advance.
My objective:
1. I want to check if QUA_AST_DNS column contains 'sglife' keyword and then check on QUA_AST_IP column if Startswith "10.181." or "10.183." If true, output as PSAS.
2. The 2nd IF statement is to check on DNS column contains 'sglife' keyword and then check on IP_address column if Startswith "10.181." or "10.183." If true, output as PSAS.
3. If both conditions above don't meet, then take LBU as output.
IF Contains([QUA_AST_DNS],'sglife') &&
(Startswith([QUA_AST_IP],"10.181.") OR
Startswith([QUA_AST_IP],"10.183.")) then 'PSAS'
ELSEIF Contains([dns],'sglife') &&
(Startswith([IP_address],"10.181.") OR
Startswith([IP_address],"10.183.")) then 'PSAS'
ELSE [LBU]
ENDIF
Solved! Go to Solution.
- Labels:
- Designer Cloud
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@Georgia_H Your formula seems to be working fine with my dummy data
IF Contains([QUA_AST_DNS], 'sglife')
AND ( StartsWith([QUA_AST_IP], '10.181.')
OR StartsWith([QUA_AST_IP], '10.183.') )
Then 'PSAS'
ELSEIF Contains([dns], 'sglife')
AND ( StartsWith([IP_address], '10.181.')
OR StartsWith([IP_address], '10.183.') )
Then 'PSAS'
Else [LBU]
EndIf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks, let me check my the results again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@Georgia_H-- quick clarification - you tagged this Designer Cloud. Are you running this on Desktop or cloud? @binuacs tested on Designer. If there are syntax issues on Cloud we'd have to test there. (note - there shouldn't be syntax issues on Cloud but...)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Apologies, it was tagged wrongly. Just running this on Desktop.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@Georgia_H are you able to fix the issue?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@binuacs Thanks for the follow up and assistance. The formula was correct. Just that we had another logic that countered the output after i applied this formula.
Cheers.
