5 Replies Latest reply on Mar 26, 2012 1:25 PM by Alex Kerin

# Summer /Winter Table calculation

I want to add two columns to the end of my data named "Summer" and "Winter" where the avg of these months are calculated. The summer calculation is fairly easy its just the avg of months April-Sept. But the Winter calculation is October-March So for 2006 its the Oct-Dec of 06 and Jan-Mar of 07. I would like the winter 06 avg to include the 07 data. What's the best way to do this calculation?

• ###### 1. Re: Summer /Winter Table calculation

Create a normal calculation (it's not a table calculation):

if datepart('month',[Year])>3 and datepart('month',[Year])<10 then "Summer"

elseif datepart('month',[Year])>9 or datepart('month',[Year])<4 then "Winter" end

If you don't have any null dates with an observation value, this could be simplified to:

if datepart('month',[Year])>3 and datepart('month',[Year])<10 then "Summer"

else "Winter" end

You can then use this with avg([Observation Value]) in a chart

• ###### 2. Re: Summer /Winter Table calculation

Thanks Alex that helped but I think my answer is slightly different still. My end goal is to be able to take off the date filter and it just be a yearly avg. like this below.

I want the 2006 winter calculation to be like the picture below

• ###### 3. Re: Summer /Winter Table calculation

Is what you highlighted in the second picture the winter of 2006 or 2007?

• ###### 4. Re: Summer /Winter Table calculation

Thats considered the winter of 2006.

• ###### 5. Re: Summer /Winter Table calculation

We need to redefine what is a year then as Feb 2006 is to be considered Winter of 2005. Pretty straightforward - take three months off the date and do a different check on the resulting date:

and