Skip to main content
Solved

Trying to use AttributeValueMapper to set one column's value based on the value of another column but it is not working. I can use it to map single values but I need to do it with ranges of values.

  • June 20, 2023
  • 2 replies
  • 22 views

michael_m
Contributor
Forum|alt.badge.img+6

I am able to use AttributeValueMapper to translate single values (ie if col1 == 1 then col2 = 'A') but I need to get it to map ranges of values, something like

if (col1 > 0 AND col1 <= 50) then col2 = 'A'

 

I keep getting 'Invalid Test Expression' errors so it sounds like I'm not writing the conditional tests correctly but I cannot see where I'm going wrong. Here's an example:

image 

Can anybody help me fix this, or point me at another way of setting a value in one column based on more than one possible value in another column?

 

Thanks,

 

Mike

Best answer by hkingsbury

I probably wouldn't do it in a AttributeValueMapper, id user either an AttributeCreator or AttributeManager. That above range should be fine, but you could also use the following logic

image

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

hkingsbury
Celebrity
Forum|alt.badge.img+63
  • Celebrity
  • 1620 replies
  • Best Answer
  • June 20, 2023

I probably wouldn't do it in a AttributeValueMapper, id user either an AttributeCreator or AttributeManager. That above range should be fine, but you could also use the following logic

image


michael_m
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • 15 replies
  • June 21, 2023

Thanks, hkingsbury. I did it in an AttributeManager and it's working well.