Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
koushik_btech20
Creator
Creator

Highest sale in which country

Hello friends I am facing a problem in finding the country which have highest sale on maximum year. The value of sales on maximum year has been stored in a variable. Now from these variable I have to found the country having highest sale on maximum year. I have attached a application. If there is any solution please share here.

6 Replies
Not applicable

try like this

firstsortedvalue(year,-sales) 

koushik_btech20
Creator
Creator
Author

The solution you have provided is not works for that matter.Inside the firstsortedvalue function we cannot use any aggr function thats why it returns an error  i.e 'Nested aggregation not allowed' and on my issue I have to find the country which have maximum sales on maximum year.

MK_QSL
MVP
MVP

=FirstSortedValue(Country,-Aggr(SUM({<Year = {'$(=Year(Today()))'}>}Sales),Country))

or

=FirstSortedValue(Country,-Aggr(SUM({<Year = {'$(=Max(Year)'}>}Sales),Country))

or

=FirstSortedValue(Country,-Aggr(SUM({<Year = {'$(=Year(Max(Date)))'}>}Sales),Country))

ashfaq_haseeb
Champion III
Champion III

Hi,

Check this

or use this

=FirstSortedValue(Country,-Aggr(sum({<Year={$(=Max(Year))}>}Sales),Country))

Regards

ASHFAQ

ashishkalia
Partner - Creator
Partner - Creator

HI kAUSHIK

pfa THIS IS T SOLUTION

CHECK THE EXPRESSION AND SORT TAB IN THE STRAIGHT TABLE.

CHEERS

Not applicable

hi,

try this expression

=concat(if(aggr(rank(sales),country<=1,country),',')

cheers,

kunal bhattacharjee