Skip to main content
Solved

Using Expression Evaluator for calculating percentages within an Attribute

  • November 22, 2020
  • 4 replies
  • 545 views

Hi, this is a really basic question, but none of the other answers I've read have quite fit. What I want to do is simple - find the percentages of these two values:Screenshot 2020-11-22 130120Screenshot 2020-11-22 130242The answer would be NoBlank - 78.22% , BothBlank - 21.78%

I'm aware the trick is to find a way to sum the Individual ID.total_count column in the Expression Evaluator, but "@sum@value(individual ID.total_count)' doesn't work, only returning the original values.

 

This so frustrating because I'm sure it's very simple.

Best answer by hkingsbury

Theres a few ways you could do it... here is one (FME 2020.1)

 

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.

4 replies

Forum|alt.badge.img+2
  • 194 replies
  • November 22, 2020

You could put a counter starting at 1 before the StatisticCalculator, add _count value to your statistics calculations for max, and then math it with the expression evaluator. It will append the 202 (or whatever the count is) to every record.


hkingsbury
Celebrity
Forum|alt.badge.img+63
  • Celebrity
  • 1625 replies
  • Best Answer
  • November 22, 2020

Theres a few ways you could do it... here is one (FME 2020.1)

 


  • Author
  • 2 replies
  • November 22, 2020

Theres a few ways you could do it... here is one (FME 2020.1)

 

This worked a charm, thanks!


  • Author
  • 2 replies
  • November 22, 2020

You could put a counter starting at 1 before the StatisticCalculator, add _count value to your statistics calculations for max, and then math it with the expression evaluator. It will append the 202 (or whatever the count is) to every record.

I found this almost worked, but the final number for the BothBlank row was 198 (I assume because 198th row was the final BothBlank row). No worries though, the answer below worked fine for me. Thanks a lot for taking the time to help anyways!