Skip to main content
Question

Data analysis post-translation with a regex string searcher.


jp12212
Contributor
Forum|alt.badge.img+4

 

Hi, I'm basically trying to create a dashboard summary of my data but in the statistics stage, want to clarify I'm heading in the right direction as my knowledge of transformers is still young.

 

I'm aggregating information based on a string searcher and want to collect all the object errors from the files and output them with the code name.

 

Hopefully this makes sense with the assistance of the below images (spreadsheet snip is a distilled version of what is in my attribute manager), in short aiming to get utilities - 10 duplicates, 5 outliers, Road - 20 duplicates, 10 outliers etc.

 

Thank you.

 

imageimage

5 replies

hkingsbury
Celebrity
Forum|alt.badge.img+54
  • Celebrity
  • October 4, 2023

Hey, i'm not 100% sure what you're asking here. Is it how to extract the central numbers from the filename column?


jp12212
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • October 5, 2023

more or less, so it searches for all issues that are from each discipline and counts / summaries them (the discipline is given by the three letters within the filename string hence the string searcher).


hkingsbury
Celebrity
Forum|alt.badge.img+54
  • Celebrity
  • October 5, 2023
jp12212 wrote:

more or less, so it searches for all issues that are from each discipline and counts / summaries them (the discipline is given by the three letters within the filename string hence the string searcher).

you can use the following regex to pull out the middle three values:

-(.{3})-

Note, it will ONLY match when there is exactly 3 values. Here are some examples:

https://rubular.com/r/ub4uRE17UcI09b


jp12212
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • October 5, 2023

Thanks for the reply, I don't think that's quite what I'm after.

 

Let me rephrase for a single case and I can scale it up.

 

Count all that satisfy '123' and Error 1 = YES and sum them. This would be fairly trivial in excel.

 

image 

 


hkingsbury
Celebrity
Forum|alt.badge.img+54
  • Celebrity
  • October 8, 2023
jp12212 wrote:

Thanks for the reply, I don't think that's quite what I'm after.

 

Let me rephrase for a single case and I can scale it up.

 

Count all that satisfy '123' and Error 1 = YES and sum them. This would be fairly trivial in excel.

 

image 

 

Right, I follow. In your original picture, you're close, I imagine the part your missing is in the statistics calculator, you want to set your group by attributes to "Error 1" and "_fist_match" (the attribute from the string searcher with the '123'). Then if you're just wanting the count, you can chose any attribute for the Statistics to Calculate attribute and check Total Count.

 

Group By is a very powerful, but potentially confusing feature of many transformers - theres a good help doc here: https://docs.safe.com/fme/html/FME-Form-Documentation/FME-Transformers/Group_Based_Transformers.htm


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