Skip to main content
Question

How to instaure a default value to continue the translation

  • November 4, 2024
  • 7 replies
  • 70 views

georedyo
Contributor
Forum|alt.badge.img+1

Hi, i’m working on water treatment facilities. I’ve to categorize them in order to write a excel file which lists the existing and some deliverable.  

I’ll try to explain the best i can : basically the data are from a gdb,  i’ve a tester to sort depending on categories. Some cat can have missing/null values, i need to “force” those missing values into the translation in ordrer to write the corresponding categories in the excel files.

my situation now is that the missing values given they’re not written shift the writting in my writer and then do not correspond with their according row.

i’ve 9 differents categories so 9 row but when i’ve just 5 filled categories, i’ve those 5 written but it change the alphabetical order in the written row so the categories dosent match the row. 

How can i say to the translator “if i’ve no values write the default value “0” else “no action””

 

Thanks, hope i’ve been clear enough

7 replies

redgeographics
Celebrity
Forum|alt.badge.img+49

Instead of the Tester you can use an AttributeManager with a conditional value for that attribute. That essentially incorporates a Tester in the AttributeManager.


geomancer
Evangelist
Forum|alt.badge.img+48
  • Evangelist
  • November 4, 2024

Maybe the NullAttributeMapper can be of help here. This transformer can replace Null values or empty strings with another value, like 0.


georedyo
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • November 5, 2024
redgeographics wrote:

Instead of the Tester you can use an AttributeManager with a conditional value for that attribute. That essentially incorporates a Tester in the AttributeManager.

Thanks for the answer. The difficult part of it is that there’s multiple attribute to deal with, the unique attribute which group all of them comes later (where i could make the conditionnal value) into the translation and is already empty. I struggle finding the good logic telling him “if i’ve no values between with theses 4 attributtes write the default value “0”


georedyo
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • November 5, 2024
geomancer wrote:

Maybe the NullAttributeMapper can be of help here. This transformer can replace Null values or empty strings with another value, like 0.

Hi thanks for the answer. yes thaught about it but since the translation doesn’t even aknowlege the empty rows (it just skips it) i can’t mapper on this particular row/attribute. do you know how to force a non skip and add an empty row ? 


geomancer
Evangelist
Forum|alt.badge.img+48
  • Evangelist
  • November 5, 2024

I'm unclear what you mean by empty rows here.

Can you provide some sample data?


georedyo
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • December 3, 2024

Hi, sorry for the late. Ok i’ll train explain the best i can with screenshot : 

 

I’ve 4 categories : 

  • water system components
  • connection terminal 
  • manholes
  • water treatment plant

as you can see, the output only give me 2 values because some values are empty/null. I want to be able to say “If the values are empy/null, the default value is 0” but i’ve to say this for each categories. I know it has to be an attribute manager instead of a tester but i struggle to translate in FME

 

 


geomancer
Evangelist
Forum|alt.badge.img+48
  • Evangelist
  • December 3, 2024

At the start of each category add a NullAttributeMapper that changes Null values or empty strings to 0.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings