How to add a calculated percentage column?

I am not sure what the easiest way to do this is but I would like to add a column that shows the percentage value of that item

For example , if I have
Apples 20
Pears 30

I would like to add a column that shows what percentage of the sum total of each item is (Apples: 40% Pears: 60%)

My first instinct was to look for a way to put the maximum of a Total node into a variable but I don’t think such a thing is possible.

A neat solution would be the admin suggestion here

Another alternative is to have a new ‘range’ transform that let you modify all the values in a table into a range (default 0 to 100) based on either the minimum/maximum/total value in each column, row or table.

But Im sure there is a way to do it now. Any suggestions?

@Nicolai
I don’t think there is a way to do it at the moment as you would need to total all the values and then divide by the total, before multiplying by 100. You can’t do this in the Javascript transform because it only allows you to calculate each row separately from the others.

You can do it ‘manually’ (e.g. we know there are 50 apples + pears, so we just work out how many of each and then multiply by 2). But that obviously isn’t satidfactory longer term.

We are still thinking through the best way to do a Range transform.

The idea of ‘variables’ is something we are considering for future versions. But perhaps not for this sort of application.

Thank you! I look forward to whatever you come up with in the future and I appreciate that it takes time to find the best way to implement. I recognise the importance of keeping the EDT infrastructure consistent and cohesive.

It isn’t too hard to program an additional transform. But every extra transform adds to the perceived complexity of the product for the end user. So we think carefully before adding a new transform.

1 Like