Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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

Tags (3)
7 Replies
rahulgupta
Contributor III

How to use >= and <= in Set Analysis

Try this:

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

Not applicable

How to use >= and <= in Set Analysis

Hi,

Or try this:

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

leni_balakrishn
Contributor III

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);

Not applicable

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

Not applicable

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

Not applicable

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

Liv$Good

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

Community Browser