Skip to main content
Announcements
Happy New Year! Cheers to another year of collaboration, connections and success.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Top two values in current month comparing the same values with previous month

Hi all Please help me out top two values in current month comparing the same with previous month.

In June the top two profitted cuntries are Argentina and Japan

In May the top two profitted cuntries are America and Argentina

What i want is when i click on jun i want both june and may data to dispaly and the comparision should be between the selected month (jun) and top two values of it  Argentina and Japan to Argentina and Japanin May

32 Replies
Not applicable
Author

Hi varsha thank you so much i have  to insert a flag into this set expression myl =1 can we insert it

Not applicable
Author

And one more final suggestion please if i dont have data in my previous month it should show as no data to display

varshavig12
Specialist
Specialist

Yes, we can insert a flag.

sum({$<MonthYear={"$(=date(AddMonths(max(MonthYear),-1),'YYYYMM'))"}, myl ={'1'} >}Value )

varshavig12
Specialist
Specialist

For two different charts, it will by default show a msg 'no data to display'. And for single chart, I'm not sure whether it is possible or not.

Not applicable
Author

Hi varsha  if there is only one value in a month it is showing 5 values in the next month this shouldn't happen it should show only one value

varshavig12
Specialist
Specialist

Sorry, I didn't get it.

Can you please elaborate ?

Not applicable
Author

Hi Varsha this solution is working fine but in the current month, ie the selected month has only one value,the problem is here in the current month it is shownig one value and this value is not showing, in the previous month and previous month is showing the top 5 values in their months can you please help me out

varshavig12
Specialist
Specialist

I'm not very sure,

But, do you mean that:

for eg: In the below screenshot; Mar2016 has only newyork, so Feb2016 should also compare for only new york. Right ?

If not, just state with an example.

I will try to help you.

Not applicable
Author

Yes varsha if i select a month and if it has only one value it should compare wit only that value in the previous month but where as when i implemented the code the current month top 1 value is showing and the same value in previous month is also showing but in the previous month the other top values are also showing i have inplemented it for top 5 values

varshavig12
Specialist
Specialist

Ahha! That is not happening with me.

Okay, let us find the cause for it.

for current Month:  ------- Make it 5 in your case

and for prev month dimension:

=if(aggr(Rank(sum({$<MonthYear={"=$(=max(MonthYear))"}>}Value)),Country)<=5,Country)

Also, for the above calculated dimension:

Supress where value is null.

And then try!

Also, are you using Personal edition ?