Skip to main content

Hello Forum,

 

I've searched previous questions, but couldn’t find an answer. I've no doubt someone has posted this before. But, sorry, I couldn’t see it.

 

I need to replace a specified value within an attribute to another value. I have an attribute (field) called Zone Type. Each cell in that attribute has one of several possible values. Where the value is "container" I need to replace it with "Outside CPZ". I don’t want to change any other values.

 

How do I do this? I've tried through AttributeManager but couldn’t work it out.

 

Thanks,

Stuart

 

 

Hi @scarter​ ,

I think the Conditional Value setting is a way to go.

See here to learn more.

https://docs.safe.com/fme/html/FME-Form-Documentation/FME-ReadersWriters/!Transformer_Parameters/Parameter_Condition_Definition_Dialog.htm


Thanks for that, takashi

I’ve added a AttributeCreator before the AttributeManager.

I’ve chosen zoneType as the Output Attribute.

In Conditional Value Definition I have Left Value as Container. I have the Operator as =. In the Value box I have Outside CPZ.

But when I run this, the cells that were Container are still Container.

Thanks,


Thanks for that, takashi

I’ve added a AttributeCreator before the AttributeManager.

I’ve chosen zoneType as the Output Attribute.

In Conditional Value Definition I have Left Value as Container. I have the Operator as =. In the Value box I have Outside CPZ.

But when I run this, the cells that were Container are still Container.

Thanks,

The Conditional Value Definition should look likd this, if I understand your requirement correctly.

fig-2If the value of "Zone Type" attribute is "container", then assign "Outside CPZ" to "Zone Type", do nothing otherwise.

fig-1


Thanks for that, takashi

I’ve added a AttributeCreator before the AttributeManager.

I’ve chosen zoneType as the Output Attribute.

In Conditional Value Definition I have Left Value as Container. I have the Operator as =. In the Value box I have Outside CPZ.

But when I run this, the cells that were Container are still Container.

Thanks,

Hi. In your image your have a Test field and a Value field. But in my Conditional Value Definition I have these fields...

  • Logic
  • Left Value
  • Operator
  • Right Value

 

I have set left value to @Value(zoneType) =Container and Right Value to Outside CPZ.

 

I don't think I have got this right.

 

 


Thanks for that, takashi

I’ve added a AttributeCreator before the AttributeManager.

I’ve chosen zoneType as the Output Attribute.

In Conditional Value Definition I have Left Value as Container. I have the Operator as =. In the Value box I have Outside CPZ.

But when I run this, the cells that were Container are still Container.

Thanks,

Conditional Value definition has a few steps. Hope this screenshot helps.

fig-3


Thanks for that, takashi

I’ve added a AttributeCreator before the AttributeManager.

I’ve chosen zoneType as the Output Attribute.

In Conditional Value Definition I have Left Value as Container. I have the Operator as =. In the Value box I have Outside CPZ.

But when I run this, the cells that were Container are still Container.

Thanks,

Hi.

 

I cant get it to work set up like that.

 

You've been very helpful, thank you. But I don't want to take up any more of your time. I'll raise a case with Support.

 

Thanks,

 


Thanks for that, takashi

I’ve added a AttributeCreator before the AttributeManager.

I’ve chosen zoneType as the Output Attribute.

In Conditional Value Definition I have Left Value as Container. I have the Operator as =. In the Value box I have Outside CPZ.

But when I run this, the cells that were Container are still Container.

Thanks,

Can you post a screenshot of what it looks like on your end?


Thanks for that, takashi

I’ve added a AttributeCreator before the AttributeManager.

I’ve chosen zoneType as the Output Attribute.

In Conditional Value Definition I have Left Value as Container. I have the Operator as =. In the Value box I have Outside CPZ.

But when I run this, the cells that were Container are still Container.

Thanks,

Thanks for that. It's all resolved now.

 

thanks,

 


Reply