Quantcast
Channel: SQLServerCentral » Reporting Services » Reporting Services » Latest topics
Viewing all articles
Browse latest Browse all 2791

SSRS2008 - Retrieve max value for group based on date

$
0
0
Hello!I have a report that shows a monthly breakdown of money retrieved and outstanding for each account. In the group header, I need to sum up the paid figures (done), and only retrieve the outstanding amount for the latest 'MonthEnd' value.I've attached an image of a dummy version which will show what I mean. Instead of '36,093' in the Outstanding header, I need it to show '10,033' (which is the value for the latest date '28/02/2015'). Gross Paid and Net Paid still need to sum up values, so they are correct as they are. The date ranges for each group can be different - e.g 'CH1' may have Dec14 - Feb15, 'CH2' may have Aug14 - Dec14 etc.I know I can do this in the original TSQL query, but I wondered if there's a quick and easy way to do so in SSRS?So far I've managed to get this, but of course it just retrieves the same value (i.e 10,033) for every single group, as it is looking at the dataset as a whole rather than the tablix grouping.[code="plain"]=lookup(MAX(Fields!MonthEnd.Value),Fields!MonthEnd.Value,Fields!Outstanding.Value,"MyAmazingDataset")[/code]

Viewing all articles
Browse latest Browse all 2791

Trending Articles