Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Error in Expression in Bar chart

Hi Frnz,

I would like to display Sum of Top 2 Accounts in year wise. Here, in every account has some values(L4AMID_VALUE_USD). I would like to calculate sum of these values and apply Top 2 on these account names. And Finally i want Sum Of Top 2 accounts.

Please find the attached QVW.

1 Solution

Accepted Solutions
Kushal_Chawda

Try below expression

sum(aggr(if(rank(sum(L4AMID_VALUE_USD),4)<=2,sum(L4AMID_VALUE_USD)),YEAR, L4ACCTNAME))

View solution in original post

10 Replies
Kushal_Chawda

Try below expression

sum(aggr(if(rank(sum(L4AMID_VALUE_USD),4)<=2,sum(L4AMID_VALUE_USD)),YEAR, L4ACCTNAME))

sunny_talwar

May be this:

sum(If(Aggr(NODISTINCT Rank(Sum(L4AMID_VALUE_USD)), L4ACCTNAME) <= 2, L4AMID_VALUE_USD))

MK_QSL
MVP
MVP

It should be

2015     26

2016     53

2017     50

Kushal_Chawda

Yes, My expression gives this result

sunny_talwar

It certainly does

MK_QSL
MVP
MVP

I think you are missing YEAR in aggregation

sum(If(Aggr(NODISTINCT Rank(Sum(L4AMID_VALUE_USD)), YEAR, L4ACCTNAME) <= 2, L4AMID_VALUE_USD))

sunny_talwar

Hahahaha ya that seem to did it Not on top of my game today.

MK_QSL
MVP
MVP

Day just started.. Long way to go for you.. Mine already half way

Not applicable
Author

Hi Frnz,,

Thanks a lot. All have given right expression. It is working..