SQL report data maniuplation
I am trying to create a SRSS 2008 report that looks like following:
Amount | Total
---------------
$11 | 5
$22 | 12
$30 | 8
This basically displays total number counts for each amount type ($11,$22 and $30).
The datasource where the report will be accessing has a table looks like following:
Quantity | TotalPrice
---------------
2 | $22 ($11 + $11)
1 | $30 ($30)
3 | $63 ($11 + $22 + $30)
So, the 开发者_运维知识库report should look something like:
Amount | Total
---------------
$11 | 3
$22 | 1
$30 | 2
Is there a SQL trick that I can ahieve this?
Thanks.
Quantity | TotalPrice
---------------
2 | $22 ($11 + $11)
1 | $30 ($30)
3 | $63 ($11 + $22 + $30)
I need to know a little bit more about the underlying/source data. Are you using sum and group by in the TotalPrice column calculation? And for example the first row from the above sample data you provided; are both 11 values stored on separate rows or is there one row that has the value of 22?
精彩评论