Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 20764

Calculating an Average in an Expression using Reporting Services with a filter or "In" within the expression

$
0
0

Hi,

I’m attempting to create an average based on a sub set of data.

In SQL the expressions would be as follows:

Createtable#temp(

Metric1float,

ApprovalLimitint

)

INSERTINTO#TEMP SELECT 1, 1

INSERTINTO#TEMP SELECT 1, 2

INSERTINTO#TEMP SELECT 2, 3

INSERTINTO#TEMP SELECT 1, 4

INSERTINTO#TEMP SELECT 3, 1

INSERTINTO#TEMP SELECT 5, 1

INSERTINTO#TEMP SELECT 4, 2

SELECTAVG(METRIC1)ThisIsTheExpressionFROM#TEMPWHERE ApprovalLimit  IN(1,2)

The Results would = 2.8

How would one write this expression?




Viewing all articles
Browse latest Browse all 20764

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>