Sum distinct values grouped in ssrs expression

Hi ALl
Need help in writting an expression
I have this kind of data 
C1 L1
10
C1 L2  
10
C1 L3
10
C2 L1
3
C2L2 
3
C3  L1 6
C3 L2 
6
Need to write an expression in SSRS calculated fieldwhich will sum  only C1L1 + C2 L1 +C3L1?
Is this possible ? Can somebody please help

Hi,
After testing the issue in my local environment, we can refer to the expression below to achieve your requirement (supposing that the L1,L2,L3 in col2 field, 10,3,6 in value field, the dataset named DataSet1):
=SUM(IIF(Fields!col2.Value="L1",Fields!value.Value,0),"DataSet1")
If there are any other questions, please feel free to ask.
Thanks,
Kathrine Xiong
Katherine Xiong
TechNet Community Support

Similar Messages

  • SSRS Expression to calculate percentage with the denominator being the first value in the same column group in a matrix report

    Hello, Expert,
    Could you please help me with the following problem? Thanks in advance!
    I have designed the matrix report (SSRS 2012) with database table structure looks like below.    
    Week           
    Version
         Count
    Week1
    V1.1
    4000
    Week1
    V1.2
    4000
    Week1
    V1.3
    4000
    Week2
    V1.1
    3000
    Week2
    V1.2
    3000
    Week2
    V1.3
    3000
    Week3
    V1.1
    2000
    Week3
    V1.2
    2000
    Week3
    V1.3
    2000
    Week4
    V1.1
    1000
    Week4
    V1.2
    1000
    Week4
    V1.3
    1000
    The matrix report displays like below. Column grows based on no of Week in the table.   
    Week1
    Week2
    Week3
    Week4
    V1.1
    4000
    3000
    2000
    1000
    V1.2
    4000
    3000
    2000
    1000
    V1.3
    4000
    3000
    2000
    1000
    What I want to do now is: instead of the Count values, I need to calculate the percentage of each week over the
    Count in Week1 so that each cell displays Count(Week2)/Count(Week1), Count(Week3)/Count(Week1), etc. What is the SSRS expression for that? I’m new to SSRS, Please help!

    Heidi,
    Thank you so much for your reply and solution! Now I know how to get the first field in a group. But I can't apply your solution directly just yet because in order to explain my problem I simplified my data structure. My real data structure has a nested
    group like this:
    Week  VersionMajor VersionMinor Count
    Week1  V1           V1.1         2000
    Week2  V1           V1.1         1500
    Week3  V1           V1.1         800
    Week1  V1           V1.2         1000
    Week2  V1           V1.2         500
    Week3  V1           V1.2         200
    Week1  V1           V1.1         2000
    Week2  V1           V1.1         1500
    Week3  V1           V1.1         800
    Week1  V1           V1.2         1000
    Week2  V1           V1.2         500
    Week3  V1           V1.2         200
    Here is the query for the above data:
    SELECT 'Week1' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 2000 AS Count
    UNION ALL
    SELECT 'Week2' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 1500 AS Count
    UNION ALL
    SELECT 'Week3' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 800 AS Count
    UNION ALL
    SELECT 'Week1' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 1000 AS Count
    UNION ALL
    SELECT 'Week2' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 500 AS Count
    UNION ALL
    SELECT 'Week3' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 200 AS Count
    UNION ALL
    SELECT 'Week1' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 2000 AS Count
    UNION ALL
    SELECT 'Week2' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 1500 AS Count
    UNION ALL
    SELECT 'Week3' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 800 AS Count
    UNION ALL
    SELECT 'Week1' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 1000 AS Count
    UNION ALL
    SELECT 'Week2' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 500 AS Count
    UNION ALL
    SELECT 'Week3' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 200 AS Count
    And my matrix table looks like this:
    What I need to do is to calculate the percentage of each week over week1 for
    1) V1 Total
    2) V1.1
    3) V1.2
    I can't use your solution directly because I need to apply Sum function for each cell and the Sum function gives me error when I try to use it on the denominator
    First(Fields!Count.Value,"VersionMinor"). If you could help me further to get to the final solution, I'd really appreciate it!!
    Happy New Year!

  • SSRS expression returns #error value in some cells

    Hello,
    What do you think below expression sometimes return #error value in ssrs.
    =SUM(Fields!X.Value / 100 * DateDiff(DateInterval.Day,Fields!s_date.Value,Fields!e_date.Value)) /
    IIF( SUM(DateDiff(DateInterval.Day,Fields!s_date.Value,Fields!e_date.Value)) = 0
    ,nothing
    ,SUM(DateDiff(DateInterval.Day,Fields!s_date.Value,Fields!e_date.Value))

    Hi,
    Use below expression to overcome the issue:
    =
    IIF( SUM(DateDiff(DateInterval.Day,Fields!s_date.Value,Fields!e_date.Value)) = 0
    , 0
    , SUM(   Fields!X.Value / 100 
    * DateDiff(DateInterval.Day,Fields!s_date.Value,Fields!e_date.Value)
      SUM(DateDiff(DateInterval.Day,Fields!s_date.Value,Fields!e_date.Value)) 
    Thanks, Madhu
    Hi madhu,
    I have value for Month field as 0. I have used MonthName function in the report. So im getting error as #Error
    Expression:
    MONTHNAME(Fields!Month.Value)& " "& Fields!Day.Value &" "&  Fields!Year.Value
    Please help me to resolve the issue.
    Thanks in Advance..
    Regards,
    LuckyAbdul

  • SSRS expression for grouping minutes

    Hi All,
    Can you please help me to write an SSRS expression to group minutes
    =SWITCH(
    Fields!TotalHours.Value = 0
    and  240,
    "0 To 4 hrs",
    Fields!TotalHours.Value = 241
    and480,
    "5 To 8 hrs",
    Fields!TotalHours.Value = 481
    and720,
    "9 To 12 hrs",
    Fields!TotalHours.Value = 721
    and960 ,
    "13 To 16 hrs",
    Fields!TotalHours.Value = 961
    and1200,
    "17 To 20 hrs",
    Fields!TotalHours.Value = 1201
    and12000000,
    "More than 20 hrs"
    Any help much appreciated
    Thanks
    Pradnya07

    Try this...
    = SWITCH ( Fields!TotalHours.Value <= 240, "0 to 4 Hrs",
    Fields!TotalHours.Value <= 480, "5 to 8 Hrs",
    Fields!TotalHours.Value <= 720, "9 to 12 Hrs",
    Fields!TotalHours.Value <= 960, "13 to 16 Hrs",
    Fields!TotalHours.Value <= 1200, "17 to 20 Hrs",
    Fields!TotalHours.Value > 1200, "More than 20 Hrs")

  • Sum rows of Column A based on distinct values of Column B

    Hello everyone,
    below is my xml
    <ROWSET>
    <ROW>
    <ORDER_NO>103-4385509</ORDER_NO>
    <SITE_NO>103</SITE_NO>
    <ORDER_ID>4385509</ORDER_ID>
    <CUSTOMER_ID>2676832</CUSTOMER_ID>
    <TAX_AMOUNT>.33</TAX_AMOUNT>
    <CREATED_DATE>08/20/2010</CREATED_DATE>
    <USER_CREATED>TSDAL671</USER_CREATED>
    <Delivery_Method>CARRY OUT STORE</Delivery_Method>
    <Entered_By>TSDAL671</Entered_By>
    <SKU_NO>321182</SKU_NO>
    <NAME_TEXT>MGR_OVERRIDE</NAME_TEXT>
    <ATTRIBUTE_ID>319</ATTRIBUTE_ID>
    <ATTRIBUTE_VALUE>Override Done</ATTRIBUTE_VALUE>
    <DETAIL_SEQ_NO>1</DETAIL_SEQ_NO>
    </ROW>
    <ROW>
    <ORDER_NO>103-4385509</ORDER_NO>
    <SITE_NO>103</SITE_NO>
    <ORDER_ID>4385509</ORDER_ID>
    <CUSTOMER_ID>2676832</CUSTOMER_ID>
    <TAX_AMOUNT>.33</TAX_AMOUNT>
    <CREATED_DATE>08/20/2010</CREATED_DATE>
    <USER_CREATED>TSDAL671</USER_CREATED>
    <Delivery_Method>CARRY OUT STORE</Delivery_Method>
    <Entered_By>TSDAL671</Entered_By>
    <SKU_NO>321182</SKU_NO>
    <NAME_TEXT>OEDTL_TAX_INFO</NAME_TEXT>
    <ATTRIBUTE_ID>314</ATTRIBUTE_ID>
    <ATTRIBUTE_VALUE>441130760|441130760|441130760|1|1|1|20100820|2676832|2|SPARTS|</ATTRIBUTE_VALUE>
    <DETAIL_SEQ_NO>1</DETAIL_SEQ_NO>
    </ROW>
    <ROW>
    <ORDER_NO>103-4385509</ORDER_NO>
    <SITE_NO>103</SITE_NO>
    <ORDER_ID>4385509</ORDER_ID>
    <CUSTOMER_ID>2676832</CUSTOMER_ID>
    <TAX_AMOUNT>.18</TAX_AMOUNT>
    <CREATED_DATE>08/20/2010</CREATED_DATE>
    <USER_CREATED>TSDAL671</USER_CREATED>
    <Delivery_Method>CARRY OUT STORE</Delivery_Method>
    <Entered_By>TSDAL671</Entered_By>
    <SKU_NO>412679</SKU_NO>
    <NAME_TEXT>OEDTL_TAX_INFO</NAME_TEXT>
    <ATTRIBUTE_ID>314</ATTRIBUTE_ID>
    <ATTRIBUTE_VALUE>441130760|441130760|441130760|1|1|1|20100820|2676832|2|0035|</ATTRIBUTE_VALUE>
    <DETAIL_SEQ_NO>2</DETAIL_SEQ_NO>
    </ROW>
    i have to display 3 rows but while doing sum of TAX_AMOUNT grouped by ORDER_ID, i need to sum only for 2 records based on the distinct value of DETAIL_SEQ
    so my output should be some thing like below
    ORDER_ID|TAX_AMOUNT|DETAIL_SEQ|ATTRIBUTE_ID
    4385509|0.33|1|319
    4385509|0.33|1|314
    4385509|0.18|2|314
    SUM = 0.51
    Note : i cannot do distinct in the sql becuase attribute_id is different for same DETAIL_SEQ_NO.
    I tired doing <?sum([xdoxslt:distinct_values(current-group()/DETAIL_SEQ_NO)]/TAX_AMOUNT)?>
    it didn't work.
    Can anyone please help me!!
    Thanks in Advance!!

    That syntax wont work.
    One method of doing.
    <?for-each-group:/ROWSET/ROW;ORDER_NO?>
    <?for-each:current-group()?>
    <?ORDER_NO?>  <?TAX_AMOUNT?>  <?DETAIL_SEQ?>  <?ATTRIBUTE_ID?>
    <?end for-each?> <?xdoxslt:set_variable($_XDOCTX,'sum_attr',0)?>
    <?for-each-group:current-group();DETAIL_SEQ_NO?>
    <?xdoxslt:set_variable($_XDOCTX,'sum_attr', xdoxslt:get_variable($_XDOCTX,'sum_attr')+ TAX_AMOUNT)?>
    <?end for-each?><?xdoxslt:get_variable($_XDOCTX,'sum_attr')?>
    <?end for-each?>

  • "How to get distinct values of sharepoint column using SSRS"

    Hi,
        I have integrated sharepoint list data to SQL Server reporting services. I am using the below to query sharepoint list data using sql reporting services.
    <Query>
       <SoapAction>http://schemas.microsoft.com/sharepoint/soap/GetListItems</SoapAction>
       <Method Namespace="http://schemas.microsoft.com/sharepoint/soap/" Name="GetListItems">
          <Parameters>
             <Parameter Name="listName">
                <DefaultValue>{GUID of list}</DefaultValue>
             </Parameter>
             <Parameter Name="viewName">
                <DefaultValue>{GUID of listview}</DefaultValue>
             </Parameter>
             <Parameter Name="rowLimit">
                <DefaultValue>9999</DefaultValue>
             </Parameter>           
          </Parameters>
       </Method>  
    <ElementPath IgnoreNamespaces="True">*</ElementPath>
    </Query>
    By using this query, I am getting a dataset which includes all the columns of sharepoint list. Among these columns, I wanted to display only 2 columns (i.e Region and Sales type) using chart. I have created a Region parameter but when I click preview, the drop down box is giving me all the repeatative values of region like RG1,RG1,RG1,RG2,RG2,RG2,RG2,RG3.......... I wanted to display only distinct values of Region parameter so that whenever end user select region from the parameter drop down, it will display the respective value of Sales type column.
    Also when I select only RG1 parameter, it is giving me a chart including the sales type of all the Regions. (it should display me only the sales type of RG1) How can I link these 2 columns so that they will display the values respectively.
              I would really appreciate if anyone can help me out with this.
    Thanks,
    Sam.

    Hi Sam,
    By code, the CAML language doesn’t have any reserved word (or tag) to set this particular filter to remove duplicate results.
    In this case, we could use the custom code to get distinct records.
    Here are the detailed steps:
    1.         Create a hidden parameter that gets all the records in one field.
    Note: Please create another dataset that is same of the main dataset. This dataset is used for the parameter.
    2.         Create a function that used to remove the duplicate records.
    Here is the code:
    Public Shared Function RemoveDups(ByVal items As String) As String
    Dim noDups As New System.Collections.ArrayList()
    Dim SpStr
    SpStr = Split(items ,",")
    For i As Integer=0 To Ubound(Spstr)
    If Not noDups.Contains(SpStr(i).Trim()) Then
    noDups.Add(SpStr(i).Trim())
    End If
    Next
    Dim uniqueItems As String() = New String(noDups.Count-1){}
    noDups.CopyTo(uniqueItems)
    Return String.Join(",", uniqueItems)
    End Function
    3.         Create another parameter that will be used for filtering the maindata.
    Please set the available value to be =Split(Code.RemoveDups(JOIN(Parameters!ISSUE_STATUS_TEMP.Value, ",")), ",")
    And the default value to be the value you what such as the first value:
    =Split(Code.RemoveDups(JOIN(Parameters!ISSUE_STATUS_TEMP.Value, ",")), ",").(0)
    4.         Go to the main dataset. Open the property window of this dataset.
    5.         In the “Filters” tab, set the filter to be:
    Expression: <The field to be filter>
    Operator: =
    Value: =Parameters!Region.Value
    The parameter “Region” should be the parameter we created in the step3.
    Now, we should get distinct values of SharePoint columns.
    If there is anything unclear, please feel free to ask.
    Thanks,
    Jin
    Jin Chen - MSFT

  • I have SSRS parametarized report in that one data set have repeated values with query parameter . but while am mapping that query parameter to report parameter i need to pass distinct values. How can i resolve this

    I have SSRS parametarized report in that one data set have repeated values with query parameter . but while am mapping that query
    parameter to report parameter i need to pass distinct values. How can i resolve this

    Hi nancharaiah,
    If I understand correctly, you want to pass distinct values to report parameter. In Reporting Service, there are only three methods for parameter's Available Values:
    None
    Specify values
    Get values from a query
    If we utilize the third option that get values from a dataset query, then the all available values are from the returns of the dataset. So if we want to pass distinct values from a dataset, we need to make the dataset returns distinct values. The following
    sample is for your reference:
    Select distinct field_name  from table_name
    If you have any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Calculating sum of distinct values

    Hello,
    I have a table with columns
    U1,U2,U3 of type VARCHAR2 and other columns as UQ1,UQ2,UQ3 as NUMBER
    I need to find out the sum of UQ1,UQ2,UQ3 column for the distinct value in U1,U2,U3 columns.
    Can we construct a sql statement to achive this?
    Cheers

    My apology, I actually didn't explained my problem properly. its infact is as following
    the table has columns U1,U2,U3 of type VARCHAR2 and other columns as UQ1,UQ2,UQ3 as NUMBER
    and i need to obtain the sum UQ1,UQ2,UQ3 for distinct values in column U1,U2,U3
    the column UQ1 hold the value for item in column U1
    and column UQ2 hold the value for item in column U2
    and column UQ3 hold the value for item in column U3
    So there could be a instance where columns U1,U2,U3 may contains the same item but difference values in columns UQ1,UQ2,UQ3 i.e.
    u1 = 'A' and uq1 = 1
    u2 = 'B' and uq2 = 4
    u3 = 'A' and uq3 = 6
    the result should be
    A, 7
    B, 4
    Can we achive this through simple construct?

  • Count distinct values current group

    Hi--
    Is there a way to count the distinct values within the current group? ie--i've got a PO and want to display all the addresses at the shipment level if there is more than one distinct one, but if they are all the same as the header-level address, then I don't want any of them to show up.
    I'm using the following at the header level to tell the header not to show up if there are multiple shipment level addresses, but can't seem to get a similar statement to work when it's sitting at the same level as the group that I want to count.
    This is what I use at the header--it seems to work:
    <?if:count(xdoxslt:distinct_values(PLL_SHIP_ADDRESS_LINE1))>1?>See Details Below<?end if?><?if:count(xdoxslt:distinct_values(PLL_SHIP_ADDRESS_LINE1))=1?>
    POH_SHIP_ADDRESS_LINE1POH_SHIP_ADDRESS_LINE1
    POH_SHIP_ADDRESS_LINE2
    POH_SHIP_ADDRESS_LINE3
    POH_SHIP_ADR_INFO POH_SHIP_COUNTRY<?end if?>
    A really simplified version of the structure of the report is below:
    <?xml version="1.0" ?>
    - <!-- Generated by Oracle Reports version 10.1.2.0.2
    -->
    - <SMTPOXPRPOP2>
    - <LIST_G_INIT_INFO>
    - <G_INIT_INFO>
    <MANUAL_PO_NUM_TYPE>NUMERIC</MANUAL_PO_NUM_TYPE>
    <C_COMPANY>CompanyName</C_COMPANY>
    - <LIST_G_HEADERS>
    - <G_HEADERS>
    <POH_PO_NUM>310001100</POH_PO_NUM>
    - <LIST_G_LINES>
    - <G_LINES>
    <POL_VENDOR_PROD_NUM>12q</POL_VENDOR_PROD_NUM>
    <POL_ITEM_DESCRIPTION>sample</POL_ITEM_DESCRIPTION>
    <POL_QUANTITY_TO_PRINT>10</POL_QUANTITY_TO_PRINT>
    - <LIST_G_SHIPMENTS>
    - <G_SHIPMENTS>
    <PLL_SHIP_COUNTRY>Canada</PLL_SHIP_COUNTRY>
    <PLL_SHIP_ADR_INFO>Calg,AB Zip</PLL_SHIP_ADR_INFO>
    <PLL_SHIP_ADDRESS_LINE3 />
    <PLL_SHIP_ADDRESS_LINE2 />
    <PLL_SHIP_ADDRESS_LINE1>Ad1</PLL_SHIP_ADDRESS_LINE1>
    </G_SHIPMENTS>
    </G_SHIPMENTS> <PLL_SHIP_COUNTRY>Canada</PLL_SHIP_COUNTRY>
    <PLL_SHIP_ADR_INFO>Calg,AB Zip</PLL_SHIP_ADR_INFO>
    <PLL_SHIP_ADDRESS_LINE3 />
    <PLL_SHIP_ADDRESS_LINE2 />
    <PLL_SHIP_ADDRESS_LINE1>Ad1</PLL_SHIP_ADDRESS_LINE1>
    </G_SHIPMENTS>
    </G_LINES>
    <POH_SHIP_ADDRESS_LINE2 />
    <POH_SHIP_COUNTRY>Canada</POH_SHIP_COUNTRY>
    <POH_SHIP_ADR_INFO>Kanata,ON K2V 0A2</POH_SHIP_ADR_INFO>
    <POH_SHIP_ADDRESS_LINE3 />
    <POH_SHIP_ADDRESS_LINE1>XXX Palladium Drive</POH_SHIP_ADDRESS_LINE1>
    </G_HEADERS>
    </LIST_G_HEADERS>
    </SMTPOXPRPOP2>
    Could anyone help out with this?
    Thanks--I'd really appreciate it!
    Kate

    Hi Vetsrini--
    Thanks for getting back to me so quickly! I'd love to email you a copy and the XML if you wouldn't mind taking a look. it'll probably be more clear than me trying to explain.
    I can't quite figure out how to do that, though---your profile doesn't list an email. Do I need to click elsewhere?
    Thanks!
    Kate

  • Select distinct values for ssrs sharepoint parameter

    hi,
    I need distinct selected values for parameter dropdown in shaepoint ssrs. Everrything will work fine if i select value and label field same field like(Location_Code). But i need value field to be different field (LocationID). like (dropdown id in value field
    and text as lable field)
    Because i am using value field in record filtering.
    Any suggestions?
    Thanks Manohara R

    Hi Manohar,
    Pls check the lin
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/6495db18-a1c1-480b-8c92-89c74ee47cf5/how-to-get-distinct-values-of-sharepoint-column-using-ssrs?forum=sqlreportingservices
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • Need to sum max values in a report with Hidden groupings

    I have looked all over and have not found my exact situation, so I am posting my first question.  I have a report that I have grouped on multiple levels.  So my report has a customer/header/detail/release grouping.  I have written a custom
    expression so that only a single value, which is the max value in the group, is shown in the detail, with all values showing in the release.  I have then set my visibility toggle to toggle on header, then detail, then release and I need to sum up those
    max values into a field on the report.  The custom expression that I have written works correctly when you are showing on the detail level.  It gives the correct value, which is the max value in each release.
    What I then need the report to do is to sum only that max value and roll that up into the header group, so that I get a total of the max values.  
    I have tried using the MAX function in my expression to get the correct max value, but I cannot get SSRS 2008 R2 to sum that, and I have tried writing a custom expression that will calculate the max (Non-zero values divided by number of non-zero records) and
    both ways work correctly until I try to rollup and sum to the next group level.
    I have also tried using a group variable and custom code to get the value and save it to a variable, but I have not had any luck in setting or getting that value correctly back to my report.
    At its most basic it feels like I should be able to set a Sum(Max(Fields!ValueColumn.Value) and let SSRS handle how that should be broken out, but after trying that repeatedly I have still had no luck.  I cannot adjust the SQL as I need the level of detail
    that the report shows, although I could add more fields as long as I don't add any groupings or totals that would reduce the granularity of that data being returned.
    Any new avenue to explore would be very helpful.
    Thank you in advance,
    Chad
     

    Ok, after continuing to search the internet I finally found the extra piece that I was missing that gave me the results I needed. The new expression looks like this:
    =runningvalue(Sum(Max(IIF(LEFT(Fields!JobNum.Value,1)="S" AND Fields!Week1STol.Value<>0, CDBL(Fields!Week1STol.Value), 0),"JobItem"),"JobItem"),SUM, "JobItem")
    In this I wrapped the original expression of Max in both a Sum and a runningvalue both at the JobItem level to get this rollup value. Now when I open the grouping I get the correct running value at each level.
    What this really gives to me is a running total at each of four groupings, even with a "max" value at the detail level. This also allows me to total a max value inline on the report, without needing a hidden row, or report footer.
    Thank you to everyone who looked at this, I hope it helps someone else. If this answer is not clear enough, please don't hesitate to add to the comments and I will try to clarify.
    Thank you, Chad

  • Issue with SSRS Expression

    Hi all, 
    I am facing some issue with ssrs expression. 
    I used below expression to show sum of budget. 
    =Sum(  CDbl(Fields!Budget.Value))
    When I preview the report it shows #Error in that textbox. 
    Please help me to fix this one , I am not getting where its breaking.. 
    Thanks
    Rohit

    Hi Rohit,
    According to your description, you want to sum the [EstimatedCostField] with an expression.
    In your scenario, since the [EstimatedCostField] is budget which you want to perform sum calculation, you should specify the sum expression like below:
    =Sum(CDbl(Fields!EstimatedCostField.Value))
    If issue persists, please run the report in the BIDS then check the warning message in output to see the detail information about the #Error. Besides, please also share the report design for our analysis.
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • How to get sum distinct in the cube. Is it possible.

    Here is the scenario.
    One report has many countries on it but only one amount.
    For a particular day we have the following data in the fact.
    TRANSACTION_DAY_NO
    Country
    Total Amount
    19900101
    US
    34
    19900101
    IND
    35
    19900101
    IND
    36
    19900101
    AUS
    37
    19900101
    UNKNOWN
    38
    19900101
    UNKNOWN
    39
    19900101
    UNKNOWN
    40
    19900101
    UNKNOWN
    41
    19900101
    UNKNOWN
    42
    19900101
    UNKNOWN
    43
    19900101
    US
    43
    19900101
    IND
    42
    There are 2 dimensions on the cube.
    Date, Country.
    I am not sure how to build a cube on this data.
    with t as (
    select 19900101 transaction_Day_no,     'US' country_no,     34 total_amount from dual union all
    select 19900101,    'IND',         35  from dual union all
    select 19900101,    'IND',         36  from dual union all
    select 19900101,    'AUS',         37  from dual union all
    select 19900101,    'UNKNOWN',    38  from dual union all
    select 19900101,    'UNKNOWN',    39  from dual union all
    select 19900101,    'UNKNOWN',    40  from dual union all
    select 19900101,    'UNKNOWN',    41  from dual union all
    select 19900101,    'UNKNOWN',    42  from dual union all
    select 19900101,    'UNKNOWN',    43  from dual union all
    select 19900101,    'US',    43  from dual union all
    select 19900101,    'IND',    42  from dual
    select transaction_day_no, country_no, sum(distinct total_amount) from t
    group by cube(transaction_Day_no, country_no);
    I am using AWM. I have tried to build by selecting the following aggregate for the cube
    max for the country_no and
    sum for the tranaction_Day_no
    But i am getting incorrect results.
    If i select sum for both country_no and transaction_no then also i get incorrect results.
    Please help me solve this issue.
    thanks

    Thanks for all your reply's.
    The problem is that i have duplicates because
    One report can have many customers.
    One customer can have many countries.
    One customer can have many reports.
    If i include the report number in the above data and do a sum on both day and report_number and max for everything else then everything is find and i am getting correct results.
    But if i take out the report dimension then i am stuffed.
    Also the problem is that i can't have one big dimension for the report as the number of reports are in access of 300M
    We have tried to solve this issue by having the fullowing.
    Dummy Cube.
    This has all the combination of all the dimension in the fact table with the report dimension as only one row(-1)
    Report Dimension for each Quarter(34M rows each)
    Quarter Cube is build.
    Then add the values from all the Quarter Cube with the Dummy Cube.
    Tried for 2 Quarter and its working fine results are correct as well.
    Only problem is that its taking a long time to build the cube because of the report dimension.
    I am trying to find a way to remove the report dimension but still use it. As we only use report dimension at level 'ALL'
    But if we do aggregation at 'ALL' level the answers are wrong again.
    Thanks for looking into this and taking time to reply.
    Regards
    Alvinder

  • Excel export sum of cells problem in ssrs report

    Hii all
    i have ssrs report when i export it to excel and try to take sum of block of cells , it just shows me row count 
    not sum of values which i have selected to sum..
    please have a look on this ..
    the data in cell is a text ..
    help please ..
    Dilip Patil..

    Hi Dilip,
    In Reporting Services, sum function returns the sum of all the non-null numeric values specified by the expression, evaluated in the given scope. If the values are text type values, we couldn’t sum the values. While we can count the values. For more details,
    please see:
    Sum Function (Report Builder and SSRS)
    After export the report to Excel format, we can also aggregate the values in Excel file. Based on my test, we can select a block of cells, then click the Quick Analysis icon to calculate the values. When the values are non-null numeric values, there are
    many calculation functions, including sum function. While the values are text type values, there is only count function under TOTALS option. So this is by design. There is no way to sum text type values, it doesn’t make sense.
    If there are any misunderstanding, please elaborate the issue for further investigation.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Distinct values in Answers

    OBIEE Answers 10 g:
    I want to select customer number column and select ecommerce metrics like orders and revenue against it .
    how do i select distinct customer Number in OBI answers . at present we do not have distinct values and i only have access to answers
    thanks
    Edited by: UOOLK on 09-Jan-2012 06:17

    Hi,
    I am sorry if I got this wrong, but I was just thinking if adding a group by 'Customer number' expression in the advanced tab might help here.
    Hope this helps.
    Thank you,
    Dhar

Maybe you are looking for

  • Couldn't find message in sxmb_moni

    Hi all, I followed the blog below to raise an exception to the XI with an Inbound Asynchronous proxy bu i couldn't find any message in the message monitor. Can any one please suggest the possible reason and how to correct it. <a href="/people/shabari

  • Changes to Real-time cube through input-field entry

    Hello, I have created query on Real-time cube (which has some data ) and enabled input-entry field for one of the key figures. 2).Created a "Push-button" to save the changes made in query. Issue : changes are not saved at cube level , when i press "P

  • Apple composite av cables

    I bought composite av cables(mb129ll/b) from apple.com and I only get audio from the tv. I plugged the cables to the same color holes, I have my iPod classic(2.0.1 pc) set to NTSC. I selected a movie and it said "tv out enabled please connect video a

  • Disk Volume Needs to be repaired... corrupt files..

    Hi, I am using a macbook pro with the latest version of os x 10.6.2 I went on utilities, Disk utilities to verify the disk. After It has been verified..it generated those two message indicating " The volume Macintosh HD was found corrupt and needs to

  • Office mobile favorite files

    Hi, everyone I have 701 bell fp1 and I have a problem with Office mobile. when I open Office mobile my files(word-excel-pdf) doesnt shown in favorite page altough I sync again and again. there are some older files that I already delete them and when