2012-07-13 2 views
1

I 이런 SSRS에 행렬을 갖는다. Datecolumn group입니다. Quantity 필드에는 데이터베이스에서 오는 번호가 있습니다. All Quantity 열에는 Quantity의 총 금액을이 Date group에 입력해야합니다. 하지만 내 표현을 사용하면 Date groups의 데이터를 사용하여 All Quantity을 계산합니다.SSRS 컬럼 그룹

나는 "2012-07-13"날짜를 의미하고 모든 수량은 1000이어야하고 "2012-06-12"날짜는 500이어야합니다. 그러나 그 대신에 두 날짜 모두 1500을 표시해야합니다. 어떻게해야합니까? 나는 이것을 해결합니까?

내 표현은 여기에 있습니다 :

Sum(Fields!Quantity.Value, "Employee") 

데이터 세트는 다음과 같이 보일 것이다 :

Employee1 Product1 200 2012-01 
Employee1 Product1 500 2012-02 
Employee1 Product1 900 2012-03 
Employee1 Product2 300 2012-01 
Employee1 Product2 500 2012-02 
Employee1 Product2 40 2012-03 
Employee2 Product1 450 2012-01 
Employee2 Product1 50 2012-02 
Employee2 Product1 30 2012-03 
Employee2 Product2 0 2012-01 
Employee2 Product2 50 2012-02 
Employee2 Product2 120 2012-03 

이 내가 무엇을의 예입니다, 내가 필요한 것을 내가 얻을 것.

//IF I USE Sum(Fields!Quantity.Value) 
        Date1      Date2 
        Quantity All Quantity Quantity All Quantity 
Employee1 Total 590   -    190   - 
        100   100    50   50 
        200   100    50   50 
        150   150    40   40 
        50   50    30   30 
        90   50    20   20 

//IF I USE Sum(Fields!Quantity.Value, "Employee") 
        Date1      Date2 
        Quantity All Quantity Quantity All Quantity 
Employee1 Total 590   -    190   - 
        100   780    50   780 
        200   780    50   780 
        150   780    40   780 
        50   780    30   780 
        90   780    20   780 

//I NEED TO GET 
        Date1      Date2 
        Quantity All Quantity Quantity All Quantity 
Employee1 Total 590   -    190   - 
        100   590    50   190 
        200   590    50   190 
        150   590    40   190 
        50   590    30   190 
        90   590    20   190 
+0

가능성은 :이 테스트하기 위해 실행 한 모형에, 나는 당신의 진짜 데이터 세트입니다 무슨 생각을 만들려면이 쿼리를 사용? – Jeroen

+0

방금 ​​추가했습니다. 매우 간단한 데이터 세트입니다. – JNM

+0

"수량"과 "모든 수량"의 차이점은 무엇입니까? 그럼에도 불구하고 그룹핑이 정확하다면 간단한 'Sum (Fields! Quantity.Value)'(어떤 그룹화도 지정하지 않음)이 트릭을 수행해야한다고 생각합니다. – Jeroen

답변

1

SQL로 작업 할 수있는 경우 RDL보다 항상 빠르지 만 보고서에서 적어도 한 가지 방법은 있습니다. 위에 두 번째 옵션을 사용하십시오. Sum (Fields! Quantity.Value, "Employee") :

아래에서 * 표시된 셀에 이름을 지정하십시오. 그것은 textbox11 또는 뭔가, 그것을 EmployeeTotal이라고합니다. 내가 캐럿^표시 한 셀에 는,이 표현

=ReportItems!EmployeeTotal.Value 

를 입력 당신은 다음 (첨부 이미지 참조) 원하는 것을 얻을 수 있습니다. 1

    Date1      Date2 
        Quantity All Quantity Quantity All Quantity 
Employee1 Total 590*   -    190   - 
        100   590^   50   190 
        200   590^   50   190 
        150   590^   40   190 
        50   590^   30   190 
        90   590    20   190 

다음 번에, 당신이 당신이 표시 할 것을 제공하는 것과 일치하는 데이터 집합 예를 제공하는 경우 우리가 당신을 도울 쉽게합니다.

당신이 질문의 끝에 샘플 데이터 집합을 추가 할 수 있습니다

![SELECT  'Employee1' AS Employee, 'Product1' AS Product, 100 AS Quantity, '2012-01' AS Date 
UNION ALL 
SELECT  'Employee1' AS Employee, 'Product2' AS Product, 200 AS Quantity, '2012-01' AS Date 
UNION ALL 
SELECT  'Employee1' AS Employee, 'Product3' AS Product, 150 AS Quantity, '2012-01' AS Date 
UNION ALL 
SELECT  'Employee1' AS Employee, 'Product4' AS Product, 50 AS Quantity, '2012-01' AS Date 
UNION ALL 
SELECT  'Employee1' AS Employee, 'Product5' AS Product, 90 AS Quantity, '2012-01' AS Date 
UNION ALL 
SELECT  'Employee1' AS Employee, 'Product1' AS Product, 50 AS Quantity, '2012-02' AS Date 
UNION ALL 
SELECT  'Employee1' AS Employee, 'Product2' AS Product, 50 AS Quantity, '2012-02' AS Date 
UNION ALL 
SELECT  'Employee1' AS Employee, 'Product3' AS Product, 40 AS Quantity, '2012-02' AS Date 
UNION ALL 
SELECT  'Employee1' AS Employee, 'Product4' AS Product, 30 AS Quantity, '2012-02' AS Date 
UNION ALL 
SELECT  'Employee1' AS Employee, 'Product5' AS Product, 20 AS Quantity, '2012-02' AS Date