Reporting Service about parameter issues

Source: Internet
Author: User

Now there's a dataset
Goods Time Warehouse Amount
A 2008-01-03 a 100
A 2008-02-01 a 80
A 2008-02-05 a 55


To make a report, the report time is 2008-02-05

Warehouse A
Goods Month Day
A 235 80 55


How can I make this form in the Reporting service, warehouse A and item A is a summary dynamic group, but the year and the day there, how do I give the expression parameters.

Hope to give answers and suggestions

Define three formulas, judge is the year, sum (), Judge is the month, sum (), judgment is the same day, sum ()

select  ' 1 '  type, warehouse, goods, sum (amount), DATEPART (Y, time)  yera
From table
where  time   <  reporting time  
group by  Warehouse, goods, DATEPART (Y, time)
UNION
select  ' 2 '  type, warehouses, goods, Sum (amount), DATEPART (m, Time)  yera,datepart (m, time)  month
From table
where  time   <  Report time  
group by  Warehouse, goods, DATEPART (Y, Time), DATEPART (M, time)
UNION
select  ' 3 ', warehouse, goods, sum (amount) , Time
From table
where  time   <  report time  
group by  Warehouse, goods, time

Data is processed in such a way that
use IIF to determine type in a report

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.