Skip to main content
Solved

Attribute Manger to concat fields based on conditions

  • September 19, 2019
  • 2 replies
  • 46 views

chris_m
Participant
Forum|alt.badge.img+1

So in my workspace I read in an Access mdb file in. Run it through two attributesplitters transformers to

split the BlockNO and LotNo fields

I the have an AttributeManager transformer setup where I try to clean up and conact the fields back together. I do this be creating 2 new attributes Block and Lot an using a condition statement to reassemble the pieces like this

However I can't format the if correctly, every case false and goes to the Else statement producing this type of output

The "." with no value after it is what I am trying to avoid.

 

Any help would be appreciated.

 

Chris M

Best answer by ebygomm

I would test for Attribute has Value rather than attribute is null

 

So if attribute Blk_List{1} has value concatenate the items together, otherwise just use Blk_List{0}

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

ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • Best Answer
  • September 19, 2019

I would test for Attribute has Value rather than attribute is null

 

So if attribute Blk_List{1} has value concatenate the items together, otherwise just use Blk_List{0}


erik_jan
Contributor
Forum|alt.badge.img+22
  • Contributor
  • 2179 replies
  • September 19, 2019

Before you do the concatenation, you can use a StringReplacer on both Block and Lot to replace (regex) .$ by nothing.

The .$ will only remove a . at the end of the string.

This should go right before the AttributeSplitter transformers.

Hope this helps.