Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ilanbaruch
Specialist
Specialist

FirstSortedValue with set analysis


hi all,

I have a straight table (best reps) with 1 dimension and 2 expressions

dimension is department, and the expressions are:

1. Rep. Name

FirstSortedValue(REP_NAME, -Aggr(Sum(AMOUNT),DEPARTMENT, REP_NAME))

2. SALES AMOUNT

Max ( aggr ( sum ( AMOUNT ), DEPARTMENT, REP_NAME ) )

I want to add an expression that will sum reps (from expression 1) the quantity  sold,

by default when I add sum(quantity ) it calculates the dimensions quantity.

any ideas?

14 Replies
sunny_talwar

May be try this:

Sum({<REP_NAME = {"=FirstSortedValue(REP_NAME, -Aggr(Sum(AMOUNT), DEPARTMENT, REP_NAME))"}>}Quantity)

ilanbaruch
Specialist
Specialist
Author

did not work

: (

tamilarasu
Champion
Champion

Like below!!

Max (aggr (sum ( Quantity ), DEPARTMENT, REP_NAME ) )

Anonymous
Not applicable

try like:

=sum({<REP_NAME={'*'}>} quantity)

ilanbaruch
Specialist
Specialist
Author

hi , it gives me the dimension quantity (department),

I need the reps quantity from expression 1


Anonymous
Not applicable

Change the dimension, take REP_NAME as Dim and Expression wud be =sum(Quantity)

ilanbaruch
Specialist
Specialist
Author

hi,

thank you for your effort,

this Expression retrieve the max quantity of the department, I need the quantity of the rep in Expression 1

Mark_Little
Luminary
Luminary

Hi,

Is it not similar to what Tamil suggested, just replace the max with sum


sum(aggr (sum ( Quantity ), DEPARTMENT, REP_NAME ) )


Mark

tamilarasu
Champion
Champion

Then try with Sum instead of Max (Mentioned by Mark).