I have a list that could contain up to 21 values. I would like to evaluate the number of values in the list and add a value to a constructed list if the list does not contain a certain value, add another value if the list contains two certain values.
To clarify more, if the list has the following values 3,4,5,8,9, 14,16,18,20, I would like to add a 1 if the list does not contain the value 14. Add a 2 if the list contains the value 14 and if the list contain another value other than the value 14.
I tried the following code
Begin Unverified Perl
my $ i = 0;
for($i = 1; $i <= LISTLENGTH("BrandCount"); $i++)
if (LISTVALUE ("BrandCount", $i) !=14)
This does not work because the last value is 20. But the 6th value is a 14 so I don't want to add a 1 to the constructed list.
Please let me know how I can accomplish this.
Thank you in advance.