Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, my name is Ben-hur, i'm from Brazil and my english is very bad, but i will try.
I have one table with 2 fields: Sales, Name of Country.
In a text box, i want to show a name of the Country with more sales.
I tried to use AGGR, but it failed.
How can i do it?
Thanks...
Hi BenHur
Try this expression
=FirstSortedValue( Product , - Aggr( Sum(Sales) , Product)) & ' ' & Max(Aggr( Sum(Sales) , Product))
regards
JJ
Hi Ben Hur,
if you don't have countries with identical maximum sales, you could use as expression in a text box:
=FirstSortedValue([Name of Country], -Sales)
Hope this helps,
Stefan
Hi Ben Hur
Try FirstSortedValue( Country , -Sales ) it gives you the county where the Sales are the greater. I use the '-' to find the greater.
Regards
JJ
Hi, sorry for this new question, but we found other problem, now in other function:
We need to show the name of Produtc with max Sum(Sales), i tried to use the same method, but it showed skewed data.
I tried it:
= FirstSortedValue(Product, -Sales) & '\n' &
Num(sum({<Product= {'$(= FirstSortedValue(Product, -Sales))'}>}Sales), 'R$ #.##0,00')
Result: Finnish Swimsuit $ 6,042.60
and it:
= FirstSortedValue(Product, -Sales) & '\n' &
Num(Max(Aggr(Sum(Sales), Product)), 'R$ #.##0,00')
Result: Finnish Swimsuit $ 13,261.61
This last sample brought the correct value, but the product is wrong. The correct product with this sales is Riviera Swimsuit.
How can i do this new expression?
Thanks for all.
Hi BenHur
Try this expression
=FirstSortedValue( Product , - Aggr( Sum(Sales) , Product)) & ' ' & Max(Aggr( Sum(Sales) , Product))
regards
JJ
it works perfectly! Thanks!