5 Replies Latest reply on Feb 1, 2019 5:15 AM by Jim Dehner

# Cannot mix agg and non agg

Hi everyone,

If for instance I want the employee that have sell the most expensive item

I'll do :

if([sales] = max(sale))

then [employee]

end

But I know that I cannot perform this because I'm not able to compare agg and non agg, so how can I do to perform this ?

• ###### 1. Re: Cannot mix agg and non agg

Hi, Alan

try this

if [sales] ={Fixed: max(sale)}

then [employee]

end

ZZ

• ###### 2. Re: Cannot mix agg and non agg

Hi Zhouyi

I cannot do this ...

My bad I gave you a wrong example

My field [PercentSMS] is already an agg function so it cannot be further aggregated

• ###### 3. Re: Cannot mix agg and non agg

Hi, Alan

Can you provide a sample workbook?

ZZ

• ###### 4. Re: Cannot mix agg and non agg

Anything with aggregation should based on some dimension values, that's why I need to know a sample workbook

• ###### 5. Re: Cannot mix agg and non agg

Good morning

Little confused - most expensive and maximum number of sales are different things

If you are looking for the most expensive item you would need to have Item in your expression something like {fixed [item] :  sum(sales)/sum(quantity) }  to get and average selling price per Item (ASP)

Then you would use that to determine the most expensive as  Most expensive =   {fixed :Max(asp)}

and determine the Item     if [ASP] = [Most Expensive] then [Item]  end

and then find the employees that sold that item = can be done with filter or conditional

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.