Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have put together the below straight table to show volume by country.
The Volume expression is sum({$<Year={$(vCurrentYear)}, Month={"<=$(=max(Month))"}>} Volume)
The rank expression is rank(sum({$<Year={$(vCurrentYear)}, Month={"<=$(=max(Month))"}>} Volume))
I've clearly done something wrong, but I haven't yet been able to figure it out! I'd like the rank to show 1 for China, 2 for Italy, 3 for Bangladesh etc.
Any help would be greatly appreciated!
Can you try this
Only({$<Year={$(vCurrentYear)}, Month={"<=$(=max(Month))"}>}
Aggr(
Rank(Sum({$<Year = {$(vCurrentYear)}, Month = {"<=$(=max(Month))"}>} Volume))
, Country)
)
Hi,
try this :
aggr(rank(sum({$<Year={$(vCurrentYear)}, Month={"<=$(=max(Month))"}>} Volume)),Country)
Marwen
Hi Both,
Thanks for your responses. Unfortiunately I'm not able to share the app.
Marwen - I have implemented your expression and it's looking a lot closer now, as per the below screenshot. I've amended the background data slightly which is why the figures don't quite match my original screenshot, but the rankings almost seem to be working. The only thing not quite right is that the rankings seem to be null for any countries where there is no volume shipped in the selected month (the volumes/rankings are based on year to date based on selected year and month, as per my original post). I'll try and figure this out now, unless anyone has any pointers?
Thanks again!
Maybe you can try o supress null values (on dimension tab) to hide countries with no volume shipped ?
or supress zéro values (on presentation tab) :
Marwen
Can you try this
Only({$<Year={$(vCurrentYear)}, Month={"<=$(=max(Month))"}>}
Aggr(
Rank(Sum({$<Year = {$(vCurrentYear)}, Month = {"<=$(=max(Month))"}>} Volume))
, Country)
)
Thanks Sunny - this solution works perfectly!
Thanks too to everyone else for your help and responses