Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to add within a set expression

I am creating a bar chart of events by year using year as the dimension and count (event) as the measure.  Most of the data is in the last few year so I wanted to add all the data in years prior to 2010 together.  In excel I would create a new variable/column and sum the years.   Could do that in the data but trying to learn how to do it inside QS.

Thanks

1 Reply
sunny_talwar

May be try like this:

RangeSum(If(Year = 2010, Sum(TOTAL {<Year = {'<2010'}>} Sales)), Sum({<Year = {'>=2010'}>} Sales))

Replace Sales by whatever your measure is.

UPDATE: Made a slight update by adding an if statement above

UPDATE2: Sample attached

Capture.PNG