I have these two if statements here. I know it is wrong because the workflow would not run.. But I can't figure out where I got it wrong. Any help will be appreciated!!
if !isnull([Route_ID])
then if [Route_ID] in (880939, 880934, 548800, 548799, 548798, 548797, 548796)
then if [Sum_ord_miles] > 2200
then ([Sum_ord_miles]-2200)*.88 + (2200*1.55)
else [Sum_ord_miles]*1.55
endif
elseif [Route_ID] not in (880939, 880934, 548800, 548799, 548798, 548797, 548796)
then if [Sum_ord_miles] > 2200
then ([Sum_ord_miles]-2200)*.99 + (2200*1.77)
else [Sum_ord_miles]*1.77
endif
else 0
end if
if !isnull([Route_ID])
then if [Route_ID] in (880939, 880934, 548800, 548799, 548798, 548797, 548796)
then if [weekly_mileage_charge] < (2200*1.55)
then (2200*1.55)-[weekly_mileage_charge]
else 0
endif
elseif [Route_ID] not in (880939, 880934, 548800, 548799, 548798, 548797, 548796)
then if [weekly_mileage_charge] < (2200*1.77)
then (2200*1.77)-[weekly_mileage_charge]
else 0
endif
else 0
endif
Solved! Go to Solution.
What is the error that you're getting @saltyplanet ?
this is the error I got
@saltyplanet Are you trying to put both of these separate statements in one expression?
Not sure if it was maybe just an error when pasting over to here, but if not, you have a space in your final 'endif' for the first one. If it's still erroring let us know and will look over it in more detail.
sorry I didn't make it clear. But I was trying to just put one if statement into just one expression.
so these are in two different expressions.
I removed the space in between and pasted it into the formula. I noticed the color is not populating... does it mean the !IsNull is already wrong? Like the [Route_ID] cannot be regconnized
In your first nested if, you're checking if Route_ID is in a certain set of values. First ensure that this field is numeric since you aren't using quotes here. Then, when you use the elseif expression
elseif [Route_ID] not in (880939, 880934, 548800, 548799, 548798, 548797, 548796)
you're checking if the value is not in that list. This isn't necessary because if the value isn't in that list, it will just fall into the "else" category without needing the full "elseif" expression.
Hope that helps point you in the right direction!
How do you get on with the following?
if !isnull([Route ID]) then
if [Route ID] in (880939, 880934, 548800, 548799, 548798, 548797, 548796)
then if [Sum_ord_miles] > 2200
then ([Sum_ord_miles]-2200)*.88 + (2200*1.55)
else [Sum_ord_miles]*1.55
endif
elseif [Sum_ord_miles] > 2200
then ([Sum_ord_miles]-2200)*.99 + (2200*1.77)
else [Sum_ord_miles]*1.77
endif
else 0
endif
User | Count |
---|---|
19 | |
15 | |
15 | |
9 | |
8 |