Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Friends,
I have following table,
| Company | Sales | Year |
|---|---|---|
| A | 205 | 2006 |
| A | 301 | 2005 |
| A | 56 | 2004 |
| B | 257 | 2006 |
| B | 654 | 2005 |
| B | 147 | 2004 |
| C | 256 | 2006 |
| C | 65 | 2005 |
| C | 59 | 2004 |
| D | 598 | 2006 |
| D | 254 | 2005 |
| D | 10 | 2004 |
and I have to find top 2 company over past 2 years, I want an output table as
| Comapany | Sales |
|---|---|
| B | 911 |
| D | 852 |
| A | 506 |
please if anyone has any idea,help me out
=sum({$<Year={vCurrentYear},Year={vLastYear}>}Sales)
Where the variables are for the two years that you want to sum over
create a table with company as a dimension, and then use an expression that outputs the sum of sales over the 2 year period
Then choose to display only the top three results
Hi
try this
=FirstSortedValue(Company,
(-aggr(sum(Sales), Company))
)
bets regards
Chris
How would I Sum of sales over 2 Year period? Thats exactly I want,please share the expression
=Sum({<Year={">$(=Max(Year)-2) <=$(=Max(Year))"}>}Sales)
=sum({$<Year={vCurrentYear},Year={vLastYear}>}Sales)
Where the variables are for the two years that you want to sum over
Take the straight table and
Dimension:- Company
Expression:- if( Rank(Sum({<Year = {'>=$(=Max(Year-1)) <=$(=Max(Year))'} >} Sales)) <= 3, Sum({<Year = {'>=$(=Max(Year-1)) <=$(=Max(Year))'} >} Sales))
This will give as out put that you want see snap

If you want to get only for last 2 years data then use
Exper:- Sum({<Year = {'>=$(=Max(Year-1)) <=$(=Max(Year))'} >} Sales))
Like this
Sorry, this one shows the top 3 values
Thank you Robert