Using RIGHT function with a list

Highlighted
Regular Contributor

Using RIGHT function with a list

Hi,

I have a field that is a list format (itemcode), and it has a 3 letter code at the end of each item (e.g product1-abc123-regular-CNC). In another field i want to check this code before carrying out a calculation.

IF RIGHT(itemcode,3) = "CNC" THEN 1 ELSE 0

I cannot use RIGHT(itemcode,3) as it is not TEXT, how can i use RIGHT with a list item ?

 

Thank you

 

2 REPLIES 2
Highlighted
Occasional Contributor

Re: Using RIGHT function with a list

Hi,

 

It kind of depends if itemcode is numeric list or not.

if yes, you can use RIGHT(itemcode.DisplayName, 3)

if no, you can use RIGHT(NAME(itemcode,3)) or RIGHT(NAME(ITEM(itemcode)),3) <- if it is in module dimension

 

I hope that helps! 🙂

 

Highlighted
Master Anaplanner/Community Boss

Re: Using RIGHT function with a list

Can you flag the condition when you create the list, rather than calculate it?

If you have a number of different conditions, it would be better to have either list properties or a module containing these properties, formatted as booleans. 

e.g. CNC?, ABC?, 123? etc. 

You could also use the above constuct if you find yourself having the same result expression for different conditions, e.g. logic1?, logic2? etc.

David