7 Replies Latest reply: Aug 24, 2011 2:51 AM by livmon26

# How to use >= and <= in Set Analysis

Hi All

May I know how can make the below script with the help of Set Analysis. I tried but not sure how use >= and <= in Set Analysis. It is taking up only if I use = but it is not taking up when I use >= and <=.

Can someone please do the required changes in the below script.

```Sum(if(DATE >= vCurMonthStartDate
AND DATE <= vCurMonthEndDate
AND TRANS_DATE >= vCurMonthStartDate
AND TRANS_DATE <= vCurMonthEndDate
AND CATEGORY='MARKETING',SALES))

```

Thanks

Attitude

• ###### How to use >= and <= in Set Analysis

Try this:

SUM({<DATE={">=\$(vCurMonthStartDate)<=\$(vCurMonthEndDate)"} ,TRANS_DATE ={">=\$( vCurMonthStartDate)<=\$(vCurMonthEndDate)"} ,CATEGORY={'MARKETING'}>}SALES)

• ###### How to use >= and <= in Set Analysis

Hi,

Or try this:

sum ({< field = {">value"} , field={"<value"},....>} sales)

• ###### Re: How to use >= and <= in Set Analysis

Hi,

Just try the below expression

sum({<DATE = {'>=\$(vCurMonthStartDate)'}, DATE ={'<=\$(vCurMonthEndDate)'},TRANS_DATE ={'>=\$(vCurMonthStartDate)'}, TRANS_DATE = {'<=\$(vCurMonthEndDate)'}, CATEGORY={'MARKETING'}>}SALES);

• ###### How to use >= and <= in Set Analysis

Hi All

Sorry for replying so late. I tried with the solution that has been provided to me but unfortunately none of them are working. It is not giving the same result what "IF Statement" has provided.

All the Set Analysis looks to be fine only but not sure why it is not giving the expected result. Is it becuase that we have missed out "AND" in the set analysis?

Regards

Attitude

• ###### How to use >= and <= in Set Analysis

Hi,

Try this.

SUM({<DATE={">=\$(#vCurMonthStartDate)<=\$(#vCurMonthEndDate)"} ,TRANS_DATE ={">=\$(#vCurMonthStartDate)<=\$(#vCurMonthEndDate)"} ,CATEGORY={'MARKETING'}>}SALES)

Regards,

Kaushik Solanki

• ###### Re: How to use >= and <= in Set Analysis

Hi,

you don't need to use the 'AND' within the set analysis. Use it like Kaushik Solanki posted. I also have such statements in usage.

sum({\$<MonthYear={'>=\$(vMY_FromDate) <=\$(vMY_ToDate)'}>} Amount)

This will sum up the all amount values from vMY_FromDate till vMY_ToDate.

vMY_FromDate and vMY_ToDate are variables which you have to define and set in dependency to your calendar.

Hope it helps.

Regards,

Claudio