count unique cols from a group in ssrs2008 r2
Hi All,
I have a column "Month" (Group). It displays 12 cols on preview. i need to calculate avg of last 3 months.
How can I achieve this.Thanks & Regards, Chaitali Thaker
May 24th, 2011 5:30am
Sorry,untested
SELECT <columns>,
AVG(colOct) OVER (PARTITION BY colOct) AvgOct,
AVG(colNov) OVER (PARTITION BY colNov) AvgNov,
AVG(colDec) OVER (PARTITION BY colDec) AvgDec
FROM tbl
Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
Free Windows Admin Tool Kit Click here and download it now
May 24th, 2011 5:33am
Hello Uri,
I need to do it in SSRS 2008 R2.
I have column group MONTH, which gives 12 months on preview.
I need avg for last 3 months . My question is how can i take last 3 months from the dynamically generated 12 cols.
eg. DESIGN VIEW:-
METRIC MONTH YES/NO
PREVIEW:-
METRIC JAN FEB MARCH ....OCT NOV DEC AVERAGE
A 1 0 1 ......1 1 0
2/3Thanks & Regards, Chaitali Thaker
May 24th, 2011 5:53am
Any Idea on this issue?Thanks & Regards, Chaitali Thaker
Free Windows Admin Tool Kit Click here and download it now
May 24th, 2011 6:36am
Then only Expression I think, like =iif field Dec then AVG..........Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
May 24th, 2011 8:06am