3 Replies Latest reply on Dec 7, 2017 12:16 PM by arvindgarg

# Grouping based on percent or records

I have 40,000 Work Orders that have roughly 50 problem types. Roughly 10 of these problem types make up 30,000 work orders. I am trying to group together the ones that make up less than 5% into an "Other" Catrgory

IF {FIXED [Problem Type] : SUM([Number of Records]) / TOTAL (SUM([Number of Records]),.5}

THEN "Other"

ELSE [Problem Type]

END

This is returning an error "Level of detail expressions contain table calculations or the ATTR function"

Could someone plase assist.

Thank you,

Bianca

• ###### 1. Re: Grouping based on percent or records

Try this:

IF {FIXED [Problem Type] : SUM([Number of Records])} / {SUM([Number of Records])} < 0.05

THEN "Other"

ELSE [Problem Type]

END

• ###### 2. Re: Grouping based on percent or records

Hi

Bianca - Total is a table calculation so it can not be used in an LOD expression (table calcs are at the bottom (last) of the order of operation)

But you can do the table calculation first and sum the number of records by Problem type then you can run your table calculation on the LOD expression

Jim

If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

• ###### 3. Re: Grouping based on percent or records

you might want to try this

IF SUM([Number of Records]) / sum({SUM([Number of Records])}) < .05

THEN "Other"

ELSE ATTR ([Problem Type])

END