Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
dmohanty
Partner - Specialist
Partner - Specialist

Set Analysis to show Max Year - 1 (Prev month values)

Hi All,

I have a chart showing All Months Data like this below:

IDSales
1100
2200
3150
4300
5250

Now I want the chart to show the Records for Max Month - 1 (Dec 2014 data). What would be the Set Analysis expression for this?

Dimension Table is like this below:

MonthYear
Jan-15
Dec-14
Nov-14
Oct-14
2 Replies
robert_mika
Master III
Master III

The topic title says Max Year -1 in the topic you want Max Month -1?

Which one is correct?

What is your desired outcome?

Can you give an example?

Anonymous
Not applicable

Hi,

Set Analysis for Previous year Maximum Month data(DEC-14)

Script:

Table:
LOAD *, Date(Date#(MonthYear,'MMM-YY'),'YY')as Year,
Date(Date#(MonthYear,'MMM-YY'),'MMM')as Month;
LOAD * Inline
[
ID,Sales,MonthYear
1,100,Jan-15
2,200,Dec-14
3,150,Nov-14
4,300,Oct-14
5,250,Feb-15
6,100,Jan-15
]
;

UI Expression:

=Sum({$<Year={$(=Max(Year)-1)},Month={$(=Max(Month))}>}Sales)

Regards

Neetha