Skip to main content
Question

How to add a new attribute showing an existing attribute as a percentage of that columns total value?

  • June 2, 2020
  • 3 replies
  • 103 views

I have a table with integer values as one of the attributes. I need to add an attribute to represent these values as a percentage of the total of these values like in the table below.

have thisneed thisvaluepercentage of total617.64705882411.76470588617.6470588238.82352941225.882352941617.64705882720.58823529

 

I figured ExpressionEvaluator is correct approach but Im pretty new to fme and cant see how it's done. Any help much would be much appreciated,

Rgds

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.

3 replies

ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • June 2, 2020

You need a statistics calculator first to get the sum of the value column, then you can use the expression evaluator to calculate the percentage


erik_jan
Contributor
Forum|alt.badge.img+22
  • Contributor
  • 2179 replies
  • June 2, 2020

StatisticsCalculator can calculate the Sum of all values in the "have this" column (use the Complete output port).

Then the "need this" can be calculated in ExpressionEvaluator (or the Arithmetic Editor of AttributeCreator) as 100 * "have this"/Sum.

Hope this helps.


  • Author
  • 1 reply
  • June 2, 2020

Thanks to you both @erik_jan and @ebygomm for you answers - very helpful - I've got this to work using the statistic calculator now. I'd previously looked at this but was mistakenly using the summary output instead of the complete output so had discounted it. Cheers