2 Replies Latest reply: Feb 26, 2015 11:51 PM by Prashant Sangle

Need help removing IF statement in front of Set Analysis

Can someone please help me figure out how to get rid of this IF statement in the beginning of my SET analysis?

This script works fine and returns the correct values:

=if(MonthYear= date(\$(=max(MonthYear)),'MMM-YYYY'),
sum({\$<
CheckYear = {\$(=Max(CheckYear))},
PrimaryPositionYN={1},
EarningsHistoryYN -= {1},
NonCashYN = {0}
>}
[Current Earnings])
)

Any help would be appreciated.

• Re: Need help removing IF statement in front of Set Analysis

Do you want calculate Sum for all MonthYear? Then try this

sum({\$<

CheckYear = {\$(=Max(CheckYear))},

PrimaryPositionYN={1},

EarningsHistoryYN -= {1},

NonCashYN = {0}

>}

[Current Earnings])

• Re: Need help removing IF statement in front of Set Analysis

Hi,

It depends what kind dimension you are using, If you are using MonthYear as Dimension also then you have to use that if statement .

If you are not using as dimension then

try

sum({\$<

MonthYear={"\$(=date(max(MonthYear),'MMM-YYYY'))"}
CheckYear = {\$(=Max(CheckYear))},
PrimaryPositionYN={1},
EarningsHistoryYN -= {1},
NonCashYN = {0}
>}
[Current Earnings])

Regards