Good Morning,
I am trying to utilize this formula to compare data between two columns and then return a specific result. When I ran the formulas individually they worked fine, however they would read everything that didn't fit that formula as a 'Flag'
Here is my formula. Am I getting something wrong with the syntax?
I have created a new column called 'Employee Hours Flag'
if [Hours] < 30000 AND [EMPLOYEE] >= 1 THEN ''
ELSEIF [Hours] < 69999 AND [EMPLOYEE] >= 2 THEN [Employee Hours FLAG]
ELSEIF [Hours] > 70000 AND [EMPLOYEE] >= 2 THEN [Employee Hours FLAG]
ELSE 'FLAG' ENDIF
Solved! Go to Solution.
if [Hours] < 30000 AND [EMPLOYEE] >= 1 THEN ''
ELSEIF [ Hours] < 69999 AND [EMPLOYEE] >= 2 THEN [Employee Hours FLAG]
ELSEIF [ Hours] > 70000 AND [EMPLOYEE] >= 2 THEN [Employee Hours FLAG]
ELSE 'FLAG' ENDIF
Hours are different variables there. First line has no space, second and third has a space before the 'H'
Thank you for your speedy reply.
I had to alter the names of Hours due to sensitive data. There are no additional spaces in the original formula.
My apologies.
Could you share a little table in here with a few examples that are giving you the error? Typing only the 3 necessarycolumns on your formula.
There is something bothering me:
"""""""""""""""""""""""""""""""""""""""""""""""""""""""
I have created a new column called 'Employee Hours Flag'
if [Hours] < 30000 AND [EMPLOYEE] >= 1 THEN ''
ELSEIF [Hours] < 69999 AND [EMPLOYEE] >= 2 THEN [Employee Hours FLAG]
ELSEIF [Hours] > 70000 AND [EMPLOYEE] >= 2 THEN [Employee Hours FLAG]
ELSE 'FLAG' ENDIF
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
The colum you are creating on the formula tool (which I suppose is a new one) is the same one you are using on the formula itself? I mean, if it was there before then everything is ok, but if not you cannot use it.
On the other side, if I'm wrong and thats not the case the formula is well written. I did use it with some dummy data and for me it works.
Would need as I said some data or the error that the WF is giving you to help you further.
Regards
Surely,
So the Employee Flag column is a new column per the formula tool.
Hours | Employee | Employee FLAG |
5000 | 1 | |
15000 | 1 | |
500 | 1 | |
1200 | 2 | |
400 | 1 | |
75000 | 1 |
Here is some sample data. I need the formula to read the hours and employee column see if they fit the criteria and then flag them if they do not. The Employee numbers will not always be 1 or 2.
That was it, I was trying to manipulate data in a column that hadn't been created yet.
I changed the [Employee FLAG] column to '' and it worked fine. Thank you!