Skip to main content
Open

StringLengthCalculator - Support Multiple Attributes

Related products:Transformers
  • October 15, 2021
  • 3 replies
  • 46 views

erooen
Contributor
Forum|alt.badge.img+2

StringLengthCalculator currently supports usage for just a single attribute. This transformer should be expanded so that multiple fields could be selected at once. This would help with determining maximum lengths of data to help troubleshoot data truncation issues, but also with validating or setting field lengths for output writers.


The output could be individual attributes or perhaps a list.

3 replies

chriswilson
Enthusiast
Forum|alt.badge.img+22
  • Enthusiast
  • October 18, 2021

Interesting idea. Once current workaround in the Attribute Manager could be using the @stringlength function from the attribute value text editor to calculate the length of a string and place it into a new attribute, or place calculations for multiple attributes into one new attribute e.g. 'Attrib a length: ' @StringLength(@value(attrib_a)), 'Attrib b length: ' @StringLength(@value(attrib_b)) etc. There could be a custom transformer idea there somewhere, Takashi is often quick at this!


wicki
Contributor
Forum|alt.badge.img+10
  • Contributor
  • October 20, 2021

Hi erooen,

maybe the AttributeValueLengthExposer (https://hub.safe.com/publishers/wicki/transformers/attributevaluelengthexposer) is exactly the custom transformer you are looking for ;-)

Perhaps, it would be great, if such a functionallity is embedded in some transformers of FME (e.g. StatisticsCalculator).


salvaleonrp
Enthusiast
Forum|alt.badge.img+21
  • Enthusiast
  • January 20, 2023

My idea along this topic is to have the String length calculator is to be part of the Visual Preview where there's an option to sort by String Length value on the column heading context menu. String length is shown in the Feature Information window. It should also be an option to pick which text attributes to count the length.

 

The use cases are similar from th OP.