Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Which one is Max Month up to data available

Hi,

We have the fields, Sales ,Year and Month.

I have to display the max year max month i.e max month obviously  Dec but I have data up to March and for remaining months there is zeros. In set analysis march should take as max month. Can any help me.

8 Replies
sarvesh
Creator III
Creator III

Hi..Kumar,

First you deside calendar either April - March or  January - December, then you can get appropriate data as per requirement.

Regard's

Sarvesh Srivastava

sunny_talwar

The below expression should give you March if March 2017 if that's the maximum month where you have Sum(Sales) > 0

Max({<MonthYear = {"=Sum(Sales) > 0"}>}Month)

or

Max({<Month = {"=Sum({<Year = {$(=Max(Year))}>}Sales) > 0"}>}Month)

sdmech81
Specialist
Specialist

May be like this:

=month(max({sale-={'0'}}date))

Attach data if not helped..

Sachin

Chanty4u
MVP
MVP

or may be

=FirstSortedvalue(Month,-Sales)

sunny_talwar

If the data looks like this

Jan - 50

Feb - 40

Mar - 30

Apr - 0

...

Your expression will give Jan. I don't think this is what is needed here.

sdmech81
Specialist
Specialist

put this into ur set as modifier and try ..it should work..

Sachin

Not applicable
Author

Hi Guys,

Thanks to every one,

@ Sarvesh  -- Calendar  Jan - Dec

@ Sunny  --  I am getting exact month number by using your expression, This is nice any way need to get values for that particular month.

@Sachin  -- I used your expressions but not getting expected results.

@sunny

Please guide me if I done any mistake

Max({<Month = {"=Sum({<Year = {$(=Max(CalYear))}>}Sales) > 0"}>}Month)

Here Month is coming from fact table  and Calyear from iland master calendar, master calendar month is Calmonth.

sunny_talwar

Would you be able to share a sample to see your issue?