Hi Everyone,
First time poster, long time reader!!!!
I am working on an issue with Webi averages that has me cursing up a storm. I just don't get what Webi is doing sometimes when it comes to calcuations especially when it comes to averages.
Here is my issue.
I have 2 years worth of data in the following format
Year | Month of Year | Value |
2013 | 1 | 5 |
2013 | 2 | 6 |
2013 | 3 | 2 |
2013 | 4 | 1 |
2013 | 5 | 6 |
2013 | 6 | 3 |
2013 | 7 | 8 |
2013 | 8 | 9 |
2013 | 9 | 2 |
2013 | 10 | 3 |
2013 | 11 | 4 |
2013 | 12 | 6 |
2014 | 1 | 7 |
2014 | 2 | 6 |
2014 | 3 | 5 |
2014 | 4 | 3 |
2014 | 5 | 2 |
2014 | 6 | 1 |
I am trying to get the average for 2013 for up to June in a single cell, I have an expression as follows
Average(Value) where Year =2013 and Month of Year <=6
When I do this I get the sum of values in 2013 up to June, however when I write the following expression
Average(Value) where Year =2013, I actually get the correct average but its for the entire year
If I write Average(Value) where Year =2013 and Month of Year =6, then I actually get the single value of 3 which makes sence.
I am at a lost, the only thing I can think of is to add another query which will exclude the remainder of the year, it just seems so ugly to do that. I want to belive there is a way to solve this using an expression.
Thanks for all your help.
Tom