How to calculate a percentage in a Matrix row SSRS

HI All,
I have the following data in a SSRS Matrix. I want the data to reflect as 'B' but I constantly get data reflected as a total.(C)
I need the percentage per row and not the whole total value.
this is my expression =count(Fields!Rejection_Reason.Value)/sum(Fields!ClaimCount.Value, "DataSet1")
A
Dealer
Total Sold
          VW
          Mercrcedez
        Honda
Dealer1
10
2
5
3
Dealer2
20
5
10
5
Dealer3
30
10
5
15
B
Dealer
Total Sold
VW
Mercedez
Honda
Dealer1
10
20.00%
50.00%
30.00%
Dealer2
20
25.00%
50.00%
25.00%
Dealer3
30
33.33%
16.67%
50.00%
C
Dealer
Total Sold
VW
Mercedez
Honda
Dealer1
10
3.33%
8.33%
5.00%
Dealer2
20
8.33%
16.67%
8.33%
Dealer3
30
16.67%
8.33%
25.00%
60
Thank you for your help.

Hi Andrevw23,
Just as michlimes suggested, we should sum the value of ClaimCount field in the Dealer group region, other than the dataset. Because the sum function sum all non-null numeric values in the specified scope. So in your scenario, we can try to use the function
below to achieve your requirement (“Dealer” means the name of Dealer group):
=count(Fields!Rejection_Reason.Value)/sum(Fields!ClaimCount.Value, "Dealer")
If you have any other questions, please feel free to ask.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support

Similar Messages

  • How to calculate Sales percentage difference between selected year and its previous year in a Matrix

    Hi,
    I'm trying to generate a report using matrix like this
                                                          Month
    Product     PreviousYearSalesAmount    SelectedYearSalesAmount      %SalesDifference
    I can populate year sales amount, but i cant calculate the percentage.
    Can Anyone help me please.
    Note: Month and Year are passed as parameters.
    Thank you.

    Hi Abhiram,
    As per my understanding you can show your fields in matrix.
    Only problem is to create the additional column which will have the  %SalesDifference value right?
    If yes,
    Just create one column as shown in below screen,
    It will create one column, Name the header of this newly created column as %SalesDifference
    In below this header , where you want to show the value for %SalesDifference as
    =sum(iif(Fields!year.Value=Parameters!year.Value,(Fields!SalesAmount.Value),-Fields!SalesAmount.Value))/Fields!SalesAmount.Value
    Set the property of the column in number as Percentage.
    run the report, you will see as below screen.
    For your reference I am attaching my RDL code, you can save as .rdl file and run the report (sample Data inside the report only)
    <?xml version="1.0" encoding="utf-8"?>
    <Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
    <Body>
    <ReportItems>
    <Textbox Name="textbox1">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value>Matrix</Value>
    <Style>
    <FontFamily>Tahoma</FontFamily>
    <FontSize>14pt</FontSize>
    <FontWeight>Bold</FontWeight>
    <Color>SteelBlue</Color>
    </Style>
    </TextRun>
    </TextRuns>
    <Style>
    <TextAlign>Center</TextAlign>
    </Style>
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>textbox1</rd:DefaultName>
    <Height>0.37in</Height>
    <Width>5in</Width>
    <Style>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    <Tablix Name="Tablix1">
    <TablixCorner>
    <TablixCornerRows>
    <TablixCornerRow>
    <TablixCornerCell>
    <CellContents>
    <Textbox Name="Textbox16">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value>Product</Value>
    <Style>
    <FontWeight>Bold</FontWeight>
    </Style>
    </TextRun>
    </TextRuns>
    <Style />
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>Textbox16</rd:DefaultName>
    <Style>
    <Border>
    <Color>LightGrey</Color>
    <Style>Solid</Style>
    </Border>
    <BackgroundColor>LightBlue</BackgroundColor>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    </CellContents>
    </TablixCornerCell>
    </TablixCornerRow>
    <TablixCornerRow>
    <TablixCornerCell>
    <CellContents>
    <Textbox Name="Textbox17">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value />
    <Style>
    <FontWeight>Bold</FontWeight>
    </Style>
    </TextRun>
    </TextRuns>
    <Style />
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>Textbox17</rd:DefaultName>
    <Style>
    <Border>
    <Color>LightGrey</Color>
    <Style>Solid</Style>
    </Border>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    </CellContents>
    </TablixCornerCell>
    </TablixCornerRow>
    </TablixCornerRows>
    </TablixCorner>
    <TablixBody>
    <TablixColumns>
    <TablixColumn>
    <Width>1.79722in</Width>
    </TablixColumn>
    <TablixColumn>
    <Width>1.76722in</Width>
    </TablixColumn>
    </TablixColumns>
    <TablixRows>
    <TablixRow>
    <Height>0.25in</Height>
    <TablixCells>
    <TablixCell>
    <CellContents>
    <Textbox Name="SalesAmount">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value>=Sum(Fields!SalesAmount.Value)</Value>
    <Style />
    </TextRun>
    </TextRuns>
    <Style />
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>SalesAmount</rd:DefaultName>
    <Style>
    <Border>
    <Color>LightGrey</Color>
    <Style>Solid</Style>
    </Border>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    </CellContents>
    </TablixCell>
    <TablixCell>
    <CellContents>
    <Textbox Name="Textbox76">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value>=sum(iif(Fields!year.Value=Parameters!year.Value,(Fields!SalesAmount.Value),-Fields!SalesAmount.Value))/Fields!SalesAmount.Value</Value>
    <Style>
    <Format>0.00%</Format>
    </Style>
    </TextRun>
    </TextRuns>
    <Style />
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>Textbox76</rd:DefaultName>
    <Style>
    <Border>
    <Color>LightGrey</Color>
    <Style>Solid</Style>
    </Border>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    </CellContents>
    </TablixCell>
    </TablixCells>
    </TablixRow>
    </TablixRows>
    </TablixBody>
    <TablixColumnHierarchy>
    <TablixMembers>
    <TablixMember>
    <Group Name="month">
    <GroupExpressions>
    <GroupExpression>=Fields!month.Value</GroupExpression>
    </GroupExpressions>
    </Group>
    <SortExpressions>
    <SortExpression>
    <Value>=Fields!month.Value</Value>
    </SortExpression>
    </SortExpressions>
    <TablixHeader>
    <Size>0.25in</Size>
    <CellContents>
    <Textbox Name="month1">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value>=MonthName(Fields!month.Value)</Value>
    <Style>
    <FontWeight>Bold</FontWeight>
    </Style>
    </TextRun>
    </TextRuns>
    <Style>
    <TextAlign>Center</TextAlign>
    </Style>
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>month1</rd:DefaultName>
    <Style>
    <Border>
    <Color>LightGrey</Color>
    <Style>Solid</Style>
    </Border>
    <BackgroundColor>LightBlue</BackgroundColor>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    </CellContents>
    </TablixHeader>
    <TablixMembers>
    <TablixMember>
    <Group Name="year">
    <GroupExpressions>
    <GroupExpression>=Fields!year.Value</GroupExpression>
    </GroupExpressions>
    </Group>
    <SortExpressions>
    <SortExpression>
    <Value>=Fields!year.Value</Value>
    </SortExpression>
    </SortExpressions>
    <TablixHeader>
    <Size>0.25in</Size>
    <CellContents>
    <Textbox Name="year">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value>=Fields!year.Value</Value>
    <Style>
    <FontWeight>Bold</FontWeight>
    </Style>
    </TextRun>
    </TextRuns>
    <Style>
    <TextAlign>Center</TextAlign>
    </Style>
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>year</rd:DefaultName>
    <Style>
    <Border>
    <Color>LightGrey</Color>
    <Style>Solid</Style>
    </Border>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    </CellContents>
    </TablixHeader>
    <TablixMembers>
    <TablixMember />
    </TablixMembers>
    </TablixMember>
    </TablixMembers>
    </TablixMember>
    <TablixMember>
    <TablixHeader>
    <Size>0.25in</Size>
    <CellContents>
    <Textbox Name="Textbox61">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value>%SalesDifference</Value>
    <Style>
    <FontStyle>Normal</FontStyle>
    <FontWeight>Bold</FontWeight>
    <TextDecoration>None</TextDecoration>
    <Color>#000000</Color>
    </Style>
    </TextRun>
    </TextRuns>
    <Style>
    <TextAlign>Center</TextAlign>
    </Style>
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>Textbox61</rd:DefaultName>
    <Style>
    <Border>
    <Color>LightGrey</Color>
    <Style>Solid</Style>
    </Border>
    <BackgroundColor>LightBlue</BackgroundColor>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    </CellContents>
    </TablixHeader>
    <TablixMembers>
    <TablixMember>
    <TablixHeader>
    <Size>0.25in</Size>
    <CellContents>
    <Textbox Name="Textbox62">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value />
    <Style>
    <FontWeight>Bold</FontWeight>
    </Style>
    </TextRun>
    </TextRuns>
    <Style />
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>Textbox62</rd:DefaultName>
    <Style>
    <Border>
    <Color>LightGrey</Color>
    <Style>Solid</Style>
    </Border>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    </CellContents>
    </TablixHeader>
    </TablixMember>
    </TablixMembers>
    </TablixMember>
    </TablixMembers>
    </TablixColumnHierarchy>
    <TablixRowHierarchy>
    <TablixMembers>
    <TablixMember>
    <Group Name="Product">
    <GroupExpressions>
    <GroupExpression>=Fields!Product.Value</GroupExpression>
    </GroupExpressions>
    </Group>
    <SortExpressions>
    <SortExpression>
    <Value>=Fields!Product.Value</Value>
    </SortExpression>
    </SortExpressions>
    <TablixHeader>
    <Size>1.38889in</Size>
    <CellContents>
    <Textbox Name="Product1">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value>=Fields!Product.Value</Value>
    <Style />
    </TextRun>
    </TextRuns>
    <Style />
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>Product1</rd:DefaultName>
    <Style>
    <Border>
    <Color>LightGrey</Color>
    <Style>Solid</Style>
    </Border>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    </CellContents>
    </TablixHeader>
    </TablixMember>
    </TablixMembers>
    </TablixRowHierarchy>
    <DataSetName>DataSet1</DataSetName>
    <Top>0.38in</Top>
    <Left>0.04667in</Left>
    <Height>0.75in</Height>
    <Width>4.95333in</Width>
    <ZIndex>1</ZIndex>
    <Style>
    <Border>
    <Style>None</Style>
    </Border>
    </Style>
    </Tablix>
    </ReportItems>
    <Height>1.20167in</Height>
    <Style />
    </Body>
    <Width>5.1in</Width>
    <Page>
    <LeftMargin>1in</LeftMargin>
    <RightMargin>1in</RightMargin>
    <TopMargin>1in</TopMargin>
    <BottomMargin>1in</BottomMargin>
    <Style />
    </Page>
    <AutoRefresh>0</AutoRefresh>
    <DataSources>
    <DataSource Name="DataSource1">
    <DataSourceReference>DataSource1</DataSourceReference>
    <rd:SecurityType>None</rd:SecurityType>
    <rd:DataSourceID>501ee6de-61fb-416f-9a92-011661d01cba</rd:DataSourceID>
    </DataSource>
    </DataSources>
    <DataSets>
    <DataSet Name="DataSet1">
    <Query>
    <DataSourceName>DataSource1</DataSourceName>
    <QueryParameters>
    <QueryParameter Name="@year">
    <Value>=Parameters!year.Value</Value>
    </QueryParameter>
    <QueryParameter Name="@Month">
    <Value>=Parameters!Month.Value</Value>
    </QueryParameter>
    </QueryParameters>
    <CommandText>select * from
    select 'apple' Product ,1 month ,2014 year,2000 SalesAmount
    union
    select 'apple' Product ,1 month,2015 year,3000 SalesAmount
    union
    select 'dell' Product ,1 month,2014 year,3000 SalesAmount
    union
    select 'dell' Product ,1 month,2015 year,2500 SalesAmount
    union
    select 'apple' Product ,2 month,2014 year,1500 SalesAmount
    union
    select 'apple' Product ,2 month,2015 year,3000 SalesAmount
    union
    select 'dell' Product ,2 month,2014 year,3000 SalesAmount
    union
    select 'dell' Product ,2 month,2015 year,5500 SalesAmount
    )t
    where year between @year-1 and @year
    and Month=@Month</CommandText>
    <rd:UseGenericDesigner>true</rd:UseGenericDesigner>
    </Query>
    <Fields>
    <Field Name="Product">
    <DataField>Product</DataField>
    <rd:TypeName>System.String</rd:TypeName>
    </Field>
    <Field Name="month">
    <DataField>month</DataField>
    <rd:TypeName>System.Int32</rd:TypeName>
    </Field>
    <Field Name="year">
    <DataField>year</DataField>
    <rd:TypeName>System.Int32</rd:TypeName>
    </Field>
    <Field Name="SalesAmount">
    <DataField>SalesAmount</DataField>
    <rd:TypeName>System.Int32</rd:TypeName>
    </Field>
    </Fields>
    </DataSet>
    </DataSets>
    <ReportParameters>
    <ReportParameter Name="year">
    <DataType>String</DataType>
    <DefaultValue>
    <Values>
    <Value>2015</Value>
    </Values>
    </DefaultValue>
    <Prompt>year</Prompt>
    </ReportParameter>
    <ReportParameter Name="Month">
    <DataType>String</DataType>
    <DefaultValue>
    <Values>
    <Value>1</Value>
    </Values>
    </DefaultValue>
    <Prompt>Month</Prompt>
    </ReportParameter>
    </ReportParameters>
    <Language>en-US</Language>
    <ConsumeContainerWhitespace>true</ConsumeContainerWhitespace>
    <rd:ReportUnitType>Inch</rd:ReportUnitType>
    <rd:ReportID>ee1a8383-6595-42b1-94f2-c68d681c85d3</rd:ReportID>
    </Report>
    Thanks
    Prasad
    Mark this as Answer if it helps you to proceed on further.

  • How to calculate milestone percentage for final milestone (billing rule 3)

    Hi,
    Client is using percentage based milestone billing. For final milestone, billing rule is set to "3 Closing invoice in milestone billing" and milestone percentage, field FPROZ, is empty without any value.
    My aim is to calculate final milestone percentage, so it would be printed on invoice layout.
    I have suggested below logic to developer:
    "If RV60F-SFPRO field is not equal to  0,00 (zero), pass billing plan VBRP-FPLNR and item numbers VBRP-FPLTR into FPLT table to get FPLT-FPROZ"
    But developer can't find RV60F-SFPRO value anyway...
    Therefore, I have a problem - how to calculate final milestone percentage in this case?
    Could anyone provide any other logic how to calculate it?

    Percentage can't be added into final milestone in SO billing plan, field FPROZ is not editable....
    Moreover, this milestone just have billing value in SO billing plan.
    I am going to use this logic that hopefully would fix the issue:
    If invoice billing type VBRP-FKART value is XXX and billing plan rule FAREG value is 1, or 3, or 4, or 5, then milestone percentage should be calculated by following formula: milestone billing value x 100 and then divided by order net value from VBAP-NETWR.
    If invoice billing type XXX, but billing plan rule is different then, no milestone percentage is not printed. This logic is valid for header and item level billing.

  • How to calculate mean value of a matrix

    Hi... I ve one matrix of order (m*n). I need to calculate the mean value of this matrix. How to do this?
    let we consider the matrix as 4x4.(Row=Column=4) The resultant matrix i.e mean value matrix is 1x4(Row=4,Column=1). To read the row value simultaneously in order to calculte the mean value thro row.... ?  please help me out
    Example:
    Matrix A=1 2 3 4
                   5 6 7 8
                   1 3 5 7
                   2 4 6 8. 
    Mean value thro row would be:   10/4 [  (1+2+3+4)/4
                                                      26/4 [ (5+6+7+8) /4...Like this i ve to do..
    Please help me out

    Hi,
      See this attachment.....
    Thanks and regards,
    srikrishnaNF
    Attachments:
    Example_VI_BD.png ‏3 KB

  • How to calculate the percentage of free space for a table in Oracle

    okay, I am a little confused here. I have been searching the web and looking at a lot of documents. What I basically want to find out is this, how do I calculate the difference between the number of bytes a table is using and the total bytes allocated to a table space (going that way to get percent free for a particular table). So I need a byte count of a table and total table space and the percentage difference. I have been looking at the DBA_TABLES DBA_TABLESPACES and DBA_SEGMENTS views. I have tried to calculated the space as num_rows * avg_row_len (if I am wrong, let me know). I have been trying to compare that calculation to the number in DBA_TABLESPACES and DBA_SEGMENTS. I am just looking for the total space allocated to the table space that the table sits in (seem logical right now) to make the percentage value work. Thus I want to be able to track the table as it grows as compated to the table space it sits in to see a value as it changes over time (days, weeks, etc.) each time I run this script I am working on.
    Can someone get me straight and help me to find out if I am looking in the right places. Any advice would help.
    Edward

    You can use a little modified version of dbms_space from Tom, show_space. Have a look,
    SQL> create table test222 as select * from all_objects;
    Table created.
    SQL> delete from test22 where rownum<=100;
    delete from test22 where rownum<=100
    ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL> delete from test222 where rownum<=100;
    100 rows deleted.
    SQL> analyze table test222 compute statistics;
    Table analyzed.
    SQL>  create or replace procedure show_space
      2  ( p_segname in varchar2,
      3    p_owner   in varchar2 default user,
      4    p_type    in varchar2 default 'TABLE',
      5    p_partition in varchar2 default NULL )
      6  -- this procedure uses authid current user so it can query DBA_*
      7  -- views using privileges from a ROLE and so it can be installed
      8  -- once per database, instead of once per user that wanted to use it
      9  authid current_user
    10  as
    11      l_free_blks                 number;
    12      l_total_blocks              number;
    13      l_total_bytes               number;
    14      l_unused_blocks             number;
    15      l_unused_bytes              number;
    16      l_LastUsedExtFileId         number;
    17      l_LastUsedExtBlockId        number;
    18      l_LAST_USED_BLOCK           number;
    19      l_segment_space_mgmt        varchar2(255);
    20      l_unformatted_blocks number;
    21      l_unformatted_bytes number;
    22      l_fs1_blocks number; l_fs1_bytes number;
    23      l_fs2_blocks number; l_fs2_bytes number;
    24      l_fs3_blocks number; l_fs3_bytes number;
    25      l_fs4_blocks number; l_fs4_bytes number;
    26      l_full_blocks number; l_full_bytes number;
    27
    28      -- inline procedure to print out numbers nicely formatted
    29      -- with a simple label
    30      procedure p( p_label in varchar2, p_num in number )
    31      is
    32      begin
    33          dbms_output.put_line( rpad(p_label,40,'.') ||
    34                                to_char(p_num,'999,999,999,999') );
    35      end;
    36  begin
    37     -- this query is executed dynamically in order to allow this procedure
    38     -- to be created by a user who has access to DBA_SEGMENTS/TABLESPACES
    39     -- via a role as is customary.
    40     -- NOTE: at runtime, the invoker MUST have access to these two
    41     -- views!
    42     -- this query determines if the object is a ASSM object or not
    43     begin
    44        execute immediate
    45            'select ts.segment_space_management
    46               from dba_segments seg, dba_tablespaces ts
    47              where seg.segment_name      = :p_segname
    48                and (:p_partition is null or
    49                    seg.partition_name = :p_partition)
    50                and seg.owner = :p_owner
    51                and seg.tablespace_name = ts.tablespace_name'
    52               into l_segment_space_mgmt
    53              using p_segname, p_partition, p_partition, p_owner;
    54     exception
    55         when too_many_rows then
    56            dbms_output.put_line
    57            ( 'This must be a partitioned table, use p_partition => ');
    58            return;
    59     end;
    60
    61
    62     -- if the object is in an ASSM tablespace, we must use this API
    63     -- call to get space information, else we use the FREE_BLOCKS
    64     -- API for the user managed segments
    65     if l_segment_space_mgmt = 'AUTO'
    66     then
    67       dbms_space.space_usage
    68       ( p_owner, p_segname, p_type, l_unformatted_blocks,
    69         l_unformatted_bytes, l_fs1_blocks, l_fs1_bytes,
    70         l_fs2_blocks, l_fs2_bytes, l_fs3_blocks, l_fs3_bytes,
    71         l_fs4_blocks, l_fs4_bytes, l_full_blocks, l_full_bytes, p_partition);
    72
    73       p( 'Unformatted Blocks ', l_unformatted_blocks );
    74       p( 'FS1 Blocks (0-25)  ', l_fs1_blocks );
    75       p( 'FS2 Blocks (25-50) ', l_fs2_blocks );
    76       p( 'FS3 Blocks (50-75) ', l_fs3_blocks );
    77       p( 'FS4 Blocks (75-100)', l_fs4_blocks );
    78       p( 'Full Blocks        ', l_full_blocks );
    79    else
    80       dbms_space.free_blocks(
    81         segment_owner     => p_owner,
    82         segment_name      => p_segname,
    83         segment_type      => p_type,
    84         freelist_group_id => 0,
    85         free_blks         => l_free_blks);
    86
    87       p( 'Free Blocks', l_free_blks );
    88    end if;
    89
    90    -- and then the unused space API call to get the rest of the
    91    -- information
    92    dbms_space.unused_space
    93    ( segment_owner     => p_owner,
    94      segment_name      => p_segname,
    95      segment_type      => p_type,
    96      partition_name    => p_partition,
    97      total_blocks      => l_total_blocks,
    98      total_bytes       => l_total_bytes,
    99      unused_blocks     => l_unused_blocks,
    100      unused_bytes      => l_unused_bytes,
    101      LAST_USED_EXTENT_FILE_ID => l_LastUsedExtFileId,
    102      LAST_USED_EXTENT_BLOCK_ID => l_LastUsedExtBlockId,
    103      LAST_USED_BLOCK => l_LAST_USED_BLOCK );
    104
    105      p( 'Total Blocks', l_total_blocks );
    106      p( 'Total Bytes', l_total_bytes );
    107      p( 'Total MBytes', trunc(l_total_bytes/1024/1024) );
    108      p( 'Unused Blocks', l_unused_blocks );
    109      p( 'Unused Bytes', l_unused_bytes );
    110      p( 'Last Used Ext FileId', l_LastUsedExtFileId );
    111      p( 'Last Used Ext BlockId', l_LastUsedExtBlockId );
    112      p( 'Last Used Block', l_LAST_USED_BLOCK );
    113  end;
    114
    115  /
    Procedure created.
    SQL> desc show_space
    PROCEDURE show_space
    Argument Name                  Type                    In/Out Default?
    P_SEGNAME                      VARCHAR2                IN
    P_OWNER                        VARCHAR2                IN     DEFAULT
    P_TYPE                         VARCHAR2                IN     DEFAULT
    P_PARTITION                    VARCHAR2                IN     DEFAULT
    SQL> set serveroutput on
    SQL> exec show_space('TEST222','SCOTT');
    BEGIN show_space('TEST222','SCOTT'); END;
    ERROR at line 1:
    ORA-00942: table or view does not exist
    ORA-06512: at "SCOTT.SHOW_SPACE", line 44
    ORA-06512: at line 1
    SQL> conn / as sysdba
    Connected.
    SQL> grant sysdba to scott;
    Grant succeeded.
    SQL> conn scott/tiger as sysdba
    Connected.
    SQL> exec show_space('TEST222','SCOTT');
    BEGIN show_space('TEST222','SCOTT'); END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00201: identifier 'SHOW_SPACE' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    SQL> exec scott.show_space('TEST222','SCOTT');
    PL/SQL procedure successfully completed.
    SQL> set serveroutput on
    SQL> exec scott.show_space('TEST222','SCOTT');
    Unformatted Blocks .....................               0
    FS1 Blocks (0-25)  .....................               0
    FS2 Blocks (25-50) .....................               1
    FS3 Blocks (50-75) .....................               0
    FS4 Blocks (75-100).....................               1
    Full Blocks        .....................             807
    Total Blocks............................             896
    Total Bytes.............................       7,340,032
    Total MBytes............................               7
    Unused Blocks...........................              65
    Unused Bytes............................         532,480
    Last Used Ext FileId....................               4
    Last Used Ext BlockId...................           1,289
    Last Used Block.........................              63
    PL/SQL procedure successfully completed.
    SQL>http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5350053031470
    I use this to find the space allocations.
    Just read your post again,this is not going to show you the percentage of the free/used space. This is going to be the number of blocks which are free/used. For the growth trend, you can look at (in 10g) Oracle EM. It has added now,Segment Growth Trend report which can show you for each object,comparing to the allocated space to the object,how much space is being used by it.
    HTH
    Aman....

  • How to calculate the Percentage differencebased on two values

    Not sure how to do this.
    Just want to calculate the % difference of two values (seem to have a problem when one value is zero)
    Here is the current output
    49 Apr 2
    64 Aug 1
    55 Feb 0
    Here is the output I would like to see
    49 Apr 2 4.08%
    64 Aug 1 1.56%
    55 Feb 0 0.00%
    Here is the current SQL
    Select TO_CHAR (RCA_CLOSE_DATE, 'Month') "Month",
    SUM (CASE WHEN RCA_CODE = 'BI&D' THEN 1 ELSE 0 END) "BI&D - CBAT No of Adj",
    Count(1) as "Count of Adjustments"
    from TW_BILL_ADJ_DATA
    where (RCA_CLOSE_DATE between nvl (:P8_DATE_FROM,FORM_RECEIVED)
    and nvl (:P8_DATE_TO, FORM_RECEIVED))
    group by TO_CHAR (RCA_CLOSE_DATE, 'Month')

    You can try something like this one:
    Select TO_CHAR (RCA_CLOSE_DATE, 'Month') "Month",
    SUM (CASE WHEN RCA_CODE = 'BI&D' THEN 1 ELSE 0 END) "BI&D - CBAT No of Adj",
    Count(1) as "Count of Adjustments",
    round(count(1)/SUM(CASE WHEN RCA_CODE = 'BI&D' THEN 1 ELSE 0 END) * 100,2) || '%' percent
    from TW_BILL_ADJ_DATA
    where (RCA_CLOSE_DATE between nvl (:P8_DATE_FROM,FORM_RECEIVED)
    and nvl (:P8_DATE_TO, FORM_RECEIVED))
    group by TO_CHAR (RCA_CLOSE_DATE, 'Month')
    CODE NOT TESTED !!!
    Best Regards
    Krystian Zieja / mob

  • How to Calculate Line items Total of Matrix Column

    hai experts,
                  Im facing a problem like
                   1. i have a matrix with a column Labour Costs in that im taking some cost.
                   2. in footer a have a Edit Text like Total Labour Cost
                   3 when i enter amount in matrix column it sholud disply that value in total labour cost and when we add new row ,labour cost it should add to 'total labour cost' in footer.Like Invoice Documents.

    Where do you want to implement this like sapscript / smartforms or adobe forms? please specify.

  • How to calculate the percentages

    Hi Gurus!!
    I am having a key figure(say suppose KF1) which had undergone currency conversions in query designer level to USD.
    Now i want one more field(KF2) in my report in which i should get the values of percentages based on KF1 and its overall result.
    Means i have 1000,2500,3400....under KF1 and the total is 25000. Finally under KF2 i should get as mentioned below
    KF1----
    >KF2
    1000----
    >(1000/25000)*100
    2500----
    >(2500/25000)*100  
    3400----
    >(3400/25000)*100
    So like wise i shold get the percentages based on KF1 and its total.
    I had tried SUMGT and %GT functions as mentioned below:
    kf1/sumgt(kf1)  and  kf1/%GT(kf1)  and for both of them the query is showing errors like you cannot use these functions in the query. correct the query.
    Pls suggest me the solution.
    Thanks in Advance
    Jiten
    Edited by: Jitendra Yuddandi on Jun 9, 2009 12:20 PM

    check these links
    http://help.sap.com/saphelp_nw04s/helpdata/en/1e/99ea3bd7896f58e10000000a11402f/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/e2/16f13a2f160f28e10000000a114084/frameset.htm

  • How to calculate a percentage of a Running Total?

    Post Author: pvang
    CA Forum: Formula
    Hi folks,    Quite new here to the forum and to Crystal Report. As you can tell, I've already stumbled upon a roadblock. Here is what I'm trying to do:I am grabbing employee names and the number of cases that they are working via a sql query. So the sql query will result in something like 'Bob', '403'; Bob being the employee and 403 being the number of cases he's working on. In the report, I have a running total that sums up the total number of cases. I want to determine the ratio of Bob's(and every other employee's) cases over the running total amount of cases. So, for demo purposes, Bob has 403 cases and the total amount of cases is 1612, Bob's ratio would be 25%(403/1612). The equation that I am using right now is: /{#RTotal})*100 and it is not working. The ratio starts at 100%(effectively because the running total after the first record is equal to his/her cases) and then drops off dramatically. I know why it is doing that, just don't want those results. I tried using the EvaluateAfter function to no avail. Is this possible? If so, how? Many thanks in advance.

    Post Author: rroberson
    CA Forum: Formula
    Sounds to me like you don't need to use a running total.  Just group on name (bob) and do a normal total (not running total) for the group (group summary).  You can just divide that group summary total by the grand total (another crystal summary) and mult by 100.

  • How to calculate cumulative percentages?

    i have a query to get month to date data
    select site,pmonth,sum(a)/sum(b)*100 as MTD
    from
    mytable
    group by site,pmonth
    Need help calculating year to date percentage..

    Hi Solomon,
    Thanks for your solution but as I'm working on percentages, it needs to be cumulative percentages.
    if i have sample data like:
    site month mtd ytd
    site1 1-jan-2011 20% 20%
    site1 1-feb-2011 30% 50%
    site1 1-mar-2011 50% 100%
    something like this..

  • [Forum FAQ] How to calculate the total count of insert rows within a Foreach Loop Container in SSIS?

    Introduction
    We need to loop through all the flat files that have the same structure in a folder and import all the data to a single SQL Server table. How can we obtain the total count of the rows inserted to the destination SQL Server table?
    Solution
    We can use Execute SQL Task or Script Task to aggregate the row count increment for each iteration of the Foreach Loop Container. The following steps are the preparations before we add the Execute SQL Task or Script Task:
    Create a String type variable FilePath, two Int32 type variables InsertRowCnt and TotalRowCnt.
    Drag a Foreach Loop Container to the Control Flow design surface, set the Enumerator to “Foreach File Enumerator”, specify the source folder and the files extension, and set the “Retrieve file name” option to “Fully qualified”.
    On the “Variable Mappings” tab of the container, map the variable FilePath to the collection value.
    Drag a Data Flow Task to the container, in the Data Flow Task, add a Flat File Source, a Row Count Transformation, and an OLE DB Destination, and join them. Create a Flat File Connection Manager to connect to one of the flat files, and then configure the
    Flat File Source as well as the OLE DB Destination adapter. Set the variable for the Row Count Transformation to “User::InsertRowCnt”.
    Open the Property Expressions Editor for the Flat File Connection Manager, and set the expression of “ConnectionString” property to
    “@[User::FilePath]”.
    (I) Execute SQL Task Method:
    In the Control Flow, drag an Execute SQL Task under the Data Flow Task and join them.
    Create one or using any one existing OLE DB Connection Manager for the Execute SQL Task, set the “ResultSet” option to “Single row”, and then set the “SQLStatement” property to:
    DECLARE @InsertRowCnt INT,
                   @TotalRowCnt INT
    SET @InsertRowCnt=?
    SET @TotalRowCnt=?
    SET @TotalRowCnt=@InsertRowCnt+@TotalRowCnt
    SELECT TotalRowCnt=@TotalRowCnt
    On to parameter 1. 
    On the “Result Set” tab of the Execute SQL Task, map result 0 to variable “User::TotalRowCnt”.
    (II) Script Task Method:
    In the Control Flow, drag a Script Task under the Data Flow Task and join them.
    In the Script Task, select variable InsertRowCnt for “ReadOnlyVariables” option, and select variable TotalRowCnt for “ReadWriteVariables”.
    Edit the Main method as follows (C#):
    public void Main()
    // TODO: Add your code here
    int InsertRowCnt = Convert.ToInt32(Dts.Variables["User::InsertRowCnt"].Value.ToString()
    int TotalRowCnt = Convert.ToInt32(Dts.Variables["User::TotalRowCnt"].Value.ToString());
    TotalRowCnt = TotalRowCnt + InsertRowCnt;
    Dts.Variables["User::InsertRowCnt"].Value = TotalRowCnt;
    Dts.TaskResult = (int)ScriptResults.Success;
              Or (VB)
              Public Sub Main()
            ' Add your code here
            Dim InsertRowCnt As Integer =        
            Convert.ToInt32(Dts.Variables("User::InsertRowCnt").Value.ToString())
            Dim TotalRowCnt As Integer =
            Convert.ToInt32(Dts.Variables("User::TotalRowCnt").Value.ToString())
            TotalRowCnt = TotalRowCnt + InsertRowCnt
            Dts.Variables("User::TotalRowCnt").Value = TotalRowCnt
            Dts.TaskResult = ScriptResults.Success
           End Sub
    Applies to
    Microsoft SQL Server 2005
    Microsoft SQL Server 2008
    Microsoft SQL Server 2008 R2
    Microsoft SQL Server 2012
    Microsoft SQL Server 2014
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Hi ITBobbyP,
    If I understand correctly, you want to load data from multiple sheets in an .xlsx file into a SQL Server table.
    If in this scenario, please refer to the following tips:
    The Foreach Loop container should be configured as shown below:
    Enumerator: Foreach ADO.NET Schema Rowset Enumerator
    Connection String: The OLE DB Connection String for the excel file.
    Schema: Tables.
    In the Variable Mapping, map the variable to Sheet_Name, and change the Index from 0 to 2.
    The connection string for Excel Connection Manager is the original one, we needn’t make any change.
    Change Table Name or View name to the variable Sheet_Name.
    If you want to load data from multiple sheets in multiple .xlsx files into a SQL Server table, please refer to following thread:
    http://stackoverflow.com/questions/7411741/how-to-loop-through-excel-files-and-load-them-into-a-database-using-ssis-package
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to calculate Maximum value in a single row in OBIEE?

    Hi,
    I have a requirement having 4 measures A,B,C,D ranked by period, P1,P2 for each branch.
    The measures are ranked for these meaures by each period and now the output is as
    Branch Name---> A for Period1-----> A for Period2------->Rank(A in Period1) ----->Rank(A in Period2)----> (and so on for other 3 measures)
    Br1---->1000---->2000---->1----->2----> and so on
    Br2----->600---->4000----->2----->1----> and so on
    From the above output, I need to calculate the top3 ranks for each branch..ie., row wise i need to calculate the top3 ranks for each branch.
    I tried using Evaluate(Greatest()) in OBIEE. But when i try to use Rank() inside Greatest(), the following error is thrown.
    Can anyone help me in this? Is there any way to achieve the output?
    Thanks in Advance.
    Regards,
    RB

    Step : 1
    Sort itab by <Field1> descending.
    Just sort the internal table by the field.
    STEP: 2
    Then read the table at index 1.
    Read table itab index 1.               
    ITAB-FIELD = MAX .                  " Max field will come in the first row of the internal table.
    Regards,
    Gurpreet

  • How to calculate value from perticular column and row in pivot table

    Hi all,
    I am having following pivot table.
    Country
    A
    B
    C
    D
    F
    G
    H
    J
    K
    L
    M
    Grand Total
    Canada
    1
    1
    3
    3
    12
    14
    13
    97
    China
    8
    4
    3
    19
    India
    2
    47
    448
    176
    395
    3656
    1964
    1360
    8077
    USA
    1545
    352
    380
    26
    10
    4
    8
    32
    2054
    1023
    758
    4624
    UK
    12
    19
    13
    23
    33
    298
    Grand Total
    1545
    352
    381
    29
    72
    474
    184
    427
    5743
    3028
    2167
    13114
    Now I want sum of Columns A, B, C, K, M where Country = India in one field.
    and sum of D, F, g in another field. and sum of remainig columns in another field.
    How can i get sum of values with some where condition in pivot table.
    Thanks,

    Hi Michael,
    Following is the representation which i want
    CouRntry
    ROW LABLES
    A
    B
    C
    Total of
    ABC
    F
    G
    Total
    Of FG
    J
    K
    L
    TOTAL
    of JL
    Grand
    Total
    Canada
    1
    1
    3
    3
    12
    14
    13
    97
    China
    8
    4
    3
    19
    India
    2
    47
    448
    176
    395
    3656
    1964
    1360
    8077
    USA
    1545
    352
    380
    26
    10
    4
    8
    32
    2054
    1023
    758
    4624
    UK
    12
    19
    13
    23
    33
    298
    Grand Total
    1545
    352
    381
    29
    72
    474
    184
    427
    5743
    3028
    2167
    1
    Also if i get sum how can i add a column in between of the fields.
    Thanks

  • How to calculate percentage of errors in DP

    Hi Gurus,
                 Can anyone tell me How to calculate the percentage of errors? 
    I had generated forecast and wanted to know how much is the error we have .
    Please let me know your answers
    Thanks a Lot
    regards,
    Raj

    Hi Gurus,
                  I just wanted to know how to get lowest percentage errors for my forecast and make business happy ?
    I am using "Auto Model selection-2" and i wanted to have lowest percentage errors and what should i do for it?
    What alpha , Beta and Gamma values need to keep in forecast profile?
    Please let me know it will be really great
    Thanks for the answers
    Regards,
    raj

  • How to calculate Pattern matrix for shading

    Fill Rectangle using linearGradient how to calculate correct format of Pattern Matrix .

    Fill rectangle using Shading Dictionary,Before that Shading Dictionary object Called from Pattern Dictionary.In this Pattern Dictionary has matrix ,i need how to calculate value of Matrix here.
    10 0 obj
    << /Type /Pattern
    /PatternType 2
    /Shading 11 0 R
    /Matrix [1.00 .00 .00 1.00 54.00 53.00]  // the matrix value how to calculate
    >>
    11 0 obj
    <<
    /ColorSpace /DeviceRGB
    /Function 12 0 R
    /ShadingType 2
    /Coords [109.2726 69.00 109.2726 .00]
    /Extend [true true]
    >>
    12 0 obj
    <<
    /FunctionType 0
    /Domain [.00 1.00]
    /Range [.00 1.00 .00 1.00 .00 1.00]
    /Size [1002]
    /BitsPerSample 8
    /Length 3006
    >>
    stream
    here is an stream of colors
    endstream
    endobj
    Can anybody help me please.
    Regards, Sasi kumar sekar.

Maybe you are looking for

  • Business Area Configuration.

    Hi, Our client is now expanding to new business, and to configure a new business area for the same.Presently no business area is defined. Pls suggest me,whether to go for new business area or new company code and we are in ECC 6.0 enviornment. Regard

  • E63 menu button not working

    Hi, When I press the menu button the bluetooth symbol disappears, the provider name (vodafone AU) flashes but nothing else happens, I can fix the problem by resetting the phone. Any ideas? Cheers

  • Acrobat Standard XI install fails with Install Interrupted

    I have a DVD for this that came with my new Fuji SnapScan. I have tried installing from the DVD, and from a copy on the Hard drive, and downloaded Acrobat Standard XI from this site, and all give me the same result. This is on a Windows 7 computer. I

  • LabView, IMAQ and NT4 SP5

    Is anyone aware of problems using Labview 5.1, IMAQ 2.2, and the IMAQ pci1408 card in a pc running NT4.0 Service pack 5? I can acquire images using the IMAQ exlorer interface, but I cannot use VIs. I get an error during IMAQ Init with a valid interfa

  • Regarding Stateless Operations in OSB Coding

    Hi, In my osb coding i have a scenario that that there are three operations. In one case i need the output of second operation(Not fully one some of the outputs) as the input to the third operation. I know that osb operations are stateless. Is there