Good day,
I created a helper Field [YearsTenure] and not trying to create another field to highlight Milestone Flag, but keep on getting Parse Error. I tried these 2 options:
if [YearsTenure]=5 then '5' AND
if [YearsTenure]=10 then '10' AND
if [YearsTenure]=15 then '15' AND
if [YearsTenure]=20 then '20' AND
if [YearsTenure]=25 then '25' AND
if [YearsTenure]=30 then '30'
else 'Non Milestone'
endif
--------------------------------
if [YearsTenure]=5 then [YearsTenure] AND
if [YearsTenure]=10 then [YearsTenure] AND
if [YearsTenure]=15 then [YearsTenure] AND
if [YearsTenure]=20 then [YearsTenure] AND
if [YearsTenure]=25 then [YearsTenure] AND
if [YearsTenure]=30 then [YearsTenure] AND
if [YearsTenure]=35 then [YearsTenure]
else 'No Milestone'
endif
Also instead of 'number', I tried to insert [YearsTenure] to return the 5/10/15/etc if the value matches...
Can't figure out what am I doing wrong...I also tried switching from string to double/int that didn't fix the issue either.
Hi @dmitkevich
Try:
if [YearsTenure]=5 then '5' ElseIf
[YearsTenure]=10 then '10' ElseIf
[YearsTenure]=15 then '15' ElseIf
[YearsTenure]=20 then '20' ElseIf
[YearsTenure]=25 then '25' ElseIf
[YearsTenure]=30 then '30'
else 'Non Milestone'
endif
@dmitkevich If you're tracking every 5 years you could simplify to and just check if the number is evenly divisible by 5
IF Mod([YearsTenure], 5) = 0 then [YearsTenure]
else 'Non Milestone'
endif
Thank you for the suggestion. I tried it but it also generated "Malformed If Statement" Error. What I am trying to do is to look at all the values in the column "YearsTenure" and if any of the values match 5/10/15/20/25/30 then return that value, otherwise mark it as "non milestone"
*Edited*
Hi @dmitkevich, YearsTenure is being created as text, change it to be Double and it should work
Here's a workflow showing both suggestions in action.
Thank you, I think I finally got it to work :D
@dmitkevich Great! Happy to help - be sure to tag the solution 😀