Jump to content

Calculated value - Sum per category


Sébastien Medhat 2

Recommended Posts

Hello,

I have the following table values :

A B

CAT1 20

CAT1 20

CAT2 40

CAT2 40

CAT3 20

CAT3 20

 

I would like to sum in a calculated value the values in column B per CAT, the final result should be in the following example to 80 (20 + 40 + 20). I tried the OVER function and Intersect, but can't find the right way.

It's been a half a day that I'm trying to figure it out.

Thank you for your precious help.

Link to comment
Share on other sites

Alright, since you are having unique values for each CAT you can use this:

Sum(If(Rank([A],[A],"ties.method=first")=1,,NULL))To understand what is gonig on here you can add twocalculated columns:

Rank([A],[A],"ties.method=first")This will rank each row within a category

If(Rank([A],[A],"ties.method=first")=1,,NULL)This will make sure that you only keep the 1st row within each catogory.

Finally, you Sum() all thoseremaining values

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...