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

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

7 Replies
rahulgupta
Partner - Creator III
Partner - Creator III

Try this:

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

Not applicable
Author

Hi,

Or try this:

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

Anonymous
Not applicable
Author

Hi,

Just try the below expression

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

Not applicable
Author

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

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    Try this.

   

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

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

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

Not applicable
Author

Liv$Good

On Aug 23, 2011 11:22 PM, "scacchic" <qliktech@sgaur.hosted.jivesoftware.com