3 Replies Latest reply: Jun 19, 2017 6:40 PM by Sunny Talwar

# Set Analysis

Hi, I am trying to sum visit counts but only if the visit_date is greater than year 2011, this expression isn't working:

Sum({<date(visit_date) >= {year(2011))}> } visit_count)

• ###### Re: Set Analysis

Hi Monica - you need to use what we call \$(dollar) expansion - it enables the Set Analysis function to use another function in the comparison.

I can work out a sample for you - but in the mean-time -I discuss this in part 2 of this Set Analysis Introduction as well:

Part 2: Set Analysis - Part 2 - Cool Stuff You Can Do (video) at the 11:45 mark

Let me see if I can quickly get you a sample.

When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.

Regards,

Qlik

• ###### Re: Set Analysis

BTW - here is an example in the community

Set analysis sum between two given dates

Please note that you can only use field names on the left of the equal sign in a set expression, no functions.

Let me know how you do

• ###### Re: Set Analysis

May be create a field in the script like this

Year(visit_date) as Year

and then like this

Sum({<Year ={'>=2011'}>} visit_count)