Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Chart sum with set expression question

Hi guys,

in my chart I need to calculate the sum of values by season: winter, spring, summer, autumn.

In the source data I have just Year and Month information. So in the load script I create a new field SEASON_YEAR:

Month Year Season_Year

01 2005 2005

02 2005 2005

... ... ...

11 2005 2005

12 2005 2006

01 2006 2006

02 2006 2006

... ... ...



So, I thought I would add 4 expressions symbolizing the 4 year seasons:

sum({<Month={12,01,02}, Year=Season_Year>} Values) - winter

...

sum({<Month={09,10,11}, Year=Season_Year>} Values) - autumn

However, this does not seem to work. At least the part Year=Season_Year does not work for sure.

What is a correct way to write this expression?

Thanks in advance.

Valera

1 Reply
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Valera,

the reason the Set Analysis condition doesn't work is because the Set Analysis condition is being evaluated "globally", outside of the individual Chart cell. You can check for Year = 2010, but you can't compare two Year fields from the same row... Hope it makes sense.

What I think you should do is use your Season_Year as a dimension instead of the Year - that way, it should work correctly.

Regards,