SOLVED
Multi-Row conditional code
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
DanielDoyle
5 - Atom
‎02-07-2024
08:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi there - I know this should be simple but I cannot figure it out!
I'm am trying to do a simple if statement where it looks at line 1 and then next row and if the ref is the same but the month fields is different then highlight this fact by updating column x for example
I am trying to use a Multi-Row
using the code
IF [Sysref]=[Row+1:SysRef] and [DateTime_Out2]=[Row+1:DateTime_Out2]then "Ok"
else "NotOk"
endif
Which returns all the ok ones which is correct - but how do I isolate all of the records where the Ref is the same but them month is different ? I cannot seem to figure out nested ifs...
So what I want:
If ref1 = ref2 then
if month1 = month2 then
"Ok"
elseif month1 not equal to month2 (but ref1 is equal to ref2)
"Not Ok"
endif
end if
Am I making sense ?
Thanks
Daniel
Solved! Go to Solution.
Labels:
- Labels:
- Help
1 REPLY 1
15 - Aurora
‎02-07-2024
08:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Not sure what you want to show for where neither of the two conditions are met, but you just need to add in another ELSEIF to test for where only condition 1 is met if condition 2 isn't:
IF [Sysref]=[Row+1:SysRef] AND [DateTime_Out2]=[Row+1:DateTime_Out2] THEN "Ok"
ELSEIF [Sysref]=[Row+1:SysRef] THEN "NotOk"
ELSE ""
endif
