You need another If activity outside the first one.
So it says this:
If row(0).ToString.Trim.ToUpper = "YES"
If row.ItemArray.Contains("***")
That way, you will look at the first column for “yes” first. Unless I am wrong on your requirement, but let me know if I am.
The part with the error:
I’m not sure what that error says, but let’s change it slightly…
You need to check if it is a number first, so do something like this:
If IsNumeric(row.Item(row.ItemArray.Count-1))
If CDbl(row.Item(row.ItemArray.Count-1)) > 0
That way, you can do somthing if the value is not a number and do something if the value is positive or negative.
Let me know if you still getting errors. I changed it to use the .Count of the itemarray as the index for the row - so it will get the last item in the row. I’ll check why .itemarray.last didn’t work later, when I get a chance.
I see there are extra columns in the row, so what you will want to do is only take the items where it is not equal empty string. There are a few ways to do this, but I will just show you how to use .Where() with the itemarray to only take the items.
So you can just store the last item to a string or double type variable using an Assign activity: Assign activity: lastValue = row.ItemArray.Select(Function(x) x.ToString.Trim).Where(Function(x) x <> "").Last
So, .Select() is used to trim all the items in the array, then .Where() is used to only take the items that do not equal empty string. .Last is used to take the last item in the array.
If you want to store this to a Double type, then you can use CDbl() around it, or since your number is in a particular format with the decimal and comma, you can try using Double.Parse()
(you might need the format as part of the parse, and I’m not 100% sure on the syntax)
After, you get the last item stored to a variable, then you change your If condition that looks at the last item to simply see if it is > 0 If activity: condition: lastValue > 0
Just remember though that you must parse your value to a double type, or it won’t be a number.