I have a table like this :
ID Jan Feb Mar
01 100 200 300
01 400 500 600
I want to group by ID, sum jan,feb, mar and rename the
sums as jan99, feb99 and mar99. And then create an
expression Q1_sales which is sum of jan99, feb99 and
mar99. Also, I need to filter it so only ID with Q1_sales
> 0 is displayed. I managed to do all of these, except the
last step. Everytime I run it, it always asks for
jan99,feb99 and mar99. It seems that I cannot use aliases
in the criteria. The final result should be like this :
ID Jan Feb Mar Q1_sales
01 500 700 900 2100
There are 2 things I can get around this problem. First,
change the having criteria in SQL to Sum(jan)+Sum(feb)+Sum
(mar)>0 OR create a second query and filter Q1_sales > 0.
Is there an easier way to do this than (1 query and no
need to play around with SQL) ?
Thanks