Calculate percentage between two rows in a matrix report with a single row group in SSRS 2008

I need your help. I have a matrix report in ssrs 2008. The report contain one field value column and one value column. I need to calculate a percentage for two values. For example : row 1 : Discount 10 Row 2 : Sales 100 Result : 10/100. I have only one
row group, I need to have a condition where Field = Discount % on Revenue then Discount/Total Turnover. Because of the  grouping for total, I am not being able to calculate the %, its just totalling the % discount. Kindly refer to the snapshot of the
report.

Hi Thanks a lot for your answer, but unfortunately it didn't work,the report is reading from a stored procedure which I have unpivot to convert all columns into rows, so that's why Discount % on Revenue, Discount and Total Turnover is found in one column.
So the Field!Col.Value is the Discount % on Revenue, Discount and Total Turnover. I have tried to change the code to
"=SUM(IIF(Fields!Col.Value = "Discount",Fields!value.Value),0))
/IIF(SUM(IIF(Fields!Col.Value = "Turnover Total",Fields!value.Value),0)) = 0 ,
Nothing,SUM(IIF(Fields!Col.Value = "Turnover Total",Fields!value.Value),0)))" but to no avail. Any other suggestion will be most welcome.
Thanks.
If everything you're getting from stored procedure then you need to calculate and bring the value from there itself.
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page

Similar Messages

  • Matrix report with literals as rows

    Hi all,
    I have been asked to write a report that lists userids as the columns and literals as the rows and the resulting counts for the cross product.
    The data is all coming from a statistics table of transactions by userid and the associated counts for a given day. The resulting report is to replace a manually created Excel spreadsheet. Having never worked with matrix reports I'm having difficulty getting the query to behave as I want.
    Here is a brief glimpse of what the user wants;
    USER1 USER2 USER3 ...
    Issued 1 2 4
    Rejected 0 4 2
    Salvaged 0 2 3
    Thanks for any help. It looks like a matrix report would be perfect for this user request, so any and all suggestions would be appreciated.
    Tom Vereecke

    Assuming 'Issued', 'Rejected' and 'Salvaged' are the fixed and these are the only values showed as rows. And also part of the table. You have to use three unions, something like that
    SELECT 'Issued' TranType, UserID, cnt
    FROM Table
    WHERE TransType = 1
    UNION
    SELECT 'Rejected', UserID, cnt
    FROM Table
    WHERE TransType = 2
    UNION
    SELECT 'Salvaged', UserID, cnt
    FROM Table
    WHERE TransType = 3
    Run Report wizard and select Matrix report.
    'TransType' will be Row Field.
    'UserID' will be Column Field.
    and 'Cnt' will be Cell Field.
    Hope this helps.

  • ___How do I calculate scale between two objects (without ArtDirector Toolkit)?

    Normally I'd use ArtDirector Toolkit, but I can't install it or oter software right now (too long to explain why).
    Anyway I have several elements to scale, and I'm trying to find a formula/calculation to determine scale.
    Example - 1 object is 3.7486" and I want to make it 5.3231" - how do I calculate the scale percentage to enlarge it?
    I know you smart forum folk can help!
    Thanks!

    142.00234754308275 %
    Hugh Betcha wrote: Normally I'd use ArtDirector Toolkit, but I can't install it or oter software right now (too long to explain why).
    Alternatively, you could Google "scale percentage between two numbers" - yields plenty of free info/calculators

  • How to calculate hours between two dateTime node in BPEL.

    In my BPEL there's a requirement need calculate hours between two dateTime type..
    I tried 2 solutions, both of them failed:
    1. use xslt calculate duration(xml type, like PT12H) between two dateTime, and then use embedded java code to get the hours.. The problem is : I need to parse the xml duration format...(like this real one: -P80DT17H47M36S....), and to parse it in java , maybe have the same problem with solution 2..
    * [Subtracting 2 dateTime values into a duration using XPath 2.0|http://blogs.oracle.com/rammenon/2007/07/subtracting_2_datetime_values.html]
    2. use embed java code, but it seems we can't use some class in embedded java code:
    my code(input begin, end both dateTime in xml. output: diff, int in xml):
    1 System.out.println("\n\nTimeTestBegin");
    2 String begin=getVariableData("begin").toString();
    3 String end=getVariableData("end").toString();
    4 System.out.println(begin+"-----"+end);
    5 //Class c1=Class.forName("javax.xml.datatype.XMLGregorianCalendar");
    6 //Class c2=Class.forName("javax.xml.datatype.DatatypeFactory");
    7 //System.out.println(c1.getName());
    8 //System.out.println(c2.getName());
    9 javax.xml.datatype.XMLGregorianCalendar beginTime = javax.xml.datatype.DatatypeFactory.newInstance().newXMLGregorianCalendar(begin);
    10 javax.xml.datatype.XMLGregorianCalendar endTime = javax.xml.datatype.DatatypeFactory.newInstance().newXMLGregorianCalendar(end);
    11 long diff=beginTime.toGregorianCalendar().getTimeInMillis()-endTime.toGregorianCalendar().getTimeInMillis();
    12 setVariableData("diff",String.valueOf(diff/1000/3600));
    13 System.out.println("DIFF======"+diff/1000/3600);
    14 System.out.println("TimeTestEnd");
    it's said can't compile java class, but can't find the detail error, I think the problem is how to import java class to embedded java code activity(use full package name like above code don't work), when I remove line 9-13, no compile error..
    BTY: Jdeveloper is a IDE support java, but why the embedded java activity's edit window only have a simple "java code" editor, too simple that it can only edit you code snippet...
    3.There's another sulotion: extend BPEL xpath functions(add a new function), but in my project, modify BPEL server(soa server)'s config file is not allowed..
    Anyone know easy solution to my problem?
    Thanks.

    Hi, All,
    I found the cause. Sorry, it's my mistake..
    below line have a DatatypeConfigurationException:
    javax.xml.datatype.DatatypeFactory.newInstance()
    When I test my java code snippet, I coped the code snippet to one of my java class in eclipse, and put it in a method to check if there's compile error, but I didn't notice there's a "throws Exception"...
    the final java code snippet for test is :
    input: begin dateTime
    input: end dateTime
    output: diff int, how many hours in (begin-end)
    try{
    System.out.println("\n\nTimeTestBegin");
    String begin=getVariableData("begin").toString();
    String end=getVariableData("end").toString();
    System.out.println(begin+"-----"+end);
    javax.xml.datatype.XMLGregorianCalendar beginTime = javax.xml.datatype.DatatypeFactory.newInstance().newXMLGregorianCalendar(begin);
    javax.xml.datatype.XMLGregorianCalendar endTime = javax.xml.datatype.DatatypeFactory.newInstance().newXMLGregorianCalendar(end);
    long diff=beginTime.toGregorianCalendar().getTimeInMillis()-endTime.toGregorianCalendar().getTimeInMillis();
    setVariableData("diff",String.valueOf(diff/1000/3600));
    System.out.println("DIFF======"+diff/1000/3600);
    System.out.println("TimeTestEnd");
    }catch(Exception e){
    e.printStackTrace();
    }

  • Calculate difference between two dates/times

    Hi all,
    Is there any function module to calculate difference between two dates/times which are in TIMESTAMPL format.
    I need to know how many millisconde(second,minutes, hours... )there is between these two times.
    Please, It is urgent
    Thank you all.
    Karim

    hi,
    try the following function
    CALL FUNCTION 'CCU_TIMESTAMP_DIFFERENCE'        
          EXPORTING                                  
               timestamp1 = timestamp1               
               timestamp2 = timestamp2               
          IMPORTING                                  
               difference = diff                     
          EXCEPTIONS                                 
               OTHERS     = 1. 
    the above function gives the difference in seconds...
    try the following  code to set the resolution to milliseconds..
    SET RUN TIME CLOCK RESOLUTION LOW
    check the thread for details:
    SET RUN TIME CLOCK RESOLUTION?
    all the best!!!
    Regards,
    Aparna

  • How to calculate days between two DATES

    How to calculate days between two DATES ?
    which is the functional module for that ?
    help me

    Hi,
    use function module : it works,
    HR_HK_DIFF_BT_2_DATES
    give output format = 03 and get the value in days.
    code is as below :
    data : DATE1 type P0001-BEGDA,
    DATE2 type P0001-BEGDA,
    YEARS type P0347-SCRYY,
    MONTHS type P0347-SCRMM,
    DAYS type P0347-SCRDD.
    date1 = '20070331'.
    date2 = '20070101'.
    CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
    EXPORTING
    DATE1 = date1
    DATE2 = date2
    OUTPUT_FORMAT = '03'
    IMPORTING
    YEARS = years
    MONTHS = months
    DAYS = days
    EXCEPTIONS
    INVALID_DATES_SPECIFIED = 1
    OTHERS = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    write : days.
    Reward points, if helpful,
    Regards,
    Sandeep Kaushik

  • Matrix report with two across groups

    Hi all,
    I am facing a problem in making a multi line matrix report.
    actually I need to make a matrix report with two "across groups", but unable to get desired result.
    if any body has any idea, please share with me.
    regards
    Ata

    No,
    you must have only 1 query which extracts all your data:
    A,q1,10
    A,q2,20
    A,q3,30
    B,q1,40
    B,q3,50
    C,q2,60
    C,q3,70
    Open report builder and create a new report from wizard.
    Select the first option accordingly with your requirements and go next.
    Type a name for your report in the title field then select "Matrix" as layout and go next.
    Select SQL Query and go next.
    Type your query.
    Select the data you want on the rows (i.e. A, B, C...) and click on the ">" button in the Matrix Row Fields section, then go next.
    Select the data you want on the columns (i.e. q1, q2, q3...) and click on the ">" button in the Matrix Column Fields section, then go next.
    Select the data you want on the cells(i.e. 10,20,30...) and click on the "Sum >" button in the Matrix Cell Fields section, then go next.
    Add some totals, if you need them.
    Go next and finish.
    Now you have a report with the following layout:
             Q1           Q2            Q3       TOT
    A        10           20            30        60
    B        40                         50        90
    C                     60            70       130
    TOT      50           80           150       280Bye
    Raffy

  • Display null rows / columns in matrix report

    Hi,
    Is it possible to display any character ('0' for example) in a matrix report where the entire row or column show no value at all ?
    My matrix shows Row1 and Row2 with values but no Row3 at all like this:
    Column1 Column2 Column3
    Row1 value1 value2 value3
    Row2 value4 value5 value6
    But I would like it to show my rows 3 with '0's :
    Column1 Column2 Column3
    Row1 value1 value2 value3
    Row2 value4 value5 value6
    Row3 0 0 0
    Thank you,
    Denise

    Make your query return 0 with nvl(column, 0) and an outer join, plus some stuff to avoid a double outer join.
    E.g. a sales per product per city:
          City1   City2  City3
    Prod1   10     100    12
    Prod2   25     110   200
    Prod3    0       0     0Could be made like this:
    create table city (c_city  varchar2(10));
    create table prod (p_prod   varchar2(10));
    create table prod_sales (ps_city varchar2(10)
    , ps_prod varchar2(10)
    , ps_sales number);
    <.....insert some values, except voor Prod3 .....>
    SQL> select p_prod, c_city, nvl(ps_sales,0)
      2  from (select c_city, p_prod from city, prod)
      3  ,    prod_sales
      4  where ps_city(+) = c_city
      5  and   ps_prod(+) = p_prod
      6  order by 1,2 ;
    P_PROD     C_CITY     NVL(PS_SALES,0)
    Prod1      City1                   10
    Prod1      City2                  100
    Prod1      City3                   12
    Prod2      City1                   25
    Prod2      City2                  110
    Prod2      City3                  200
    Prod3      City1                    0
    Prod3      City2                    0
    Prod3      City3                    0

  • Tree Matrix Report with double line heading

    Hi,
    I am very new to HTML-DB and HTML as well.
    I need to create a matrix report with a tree functionality and with two line heading.
    Basically This is what I need to generate
    REGION1 REGION2 REGION3
    COL1 COL2 TOTAL COL1 COL2 TOTAL COL1 COL2 TOTAL
    ===========================================================
    CAT1+
    Sub_CAT1
    Sub_CAT2
    CAT2+
    Sub_SCAT3
    Sub_SCAT4
    Where CAT1 , CAT2 needs to be collapsible rows. SCAT1..SCAT4 are sub categories under main categories.
    REGION1.... REGION3 are top level headings. And COL1,COL2 are sub headings under top level headings.
    Thanks,
    Shri

    Please help me on this!
    Thanks,
    Shri

  • Matrix report with group.

    dear all,
    can anyone guide me how to build a matrix report with group using scott schema.
    i can not be able to build a query.
    Thanks
    Muhammad Nadeem

    The example given by Oracle (from the above link) using the following SQL for a matrix report is flawed.
    SELECT DEPTNO, JOB, SUM(SAL)
    FROM EMP
    GROUP BY DEPTNO, JOB
    ORDER BY DEPTNO, JOB
    The SUM function handled by the query restricts you from doing so many things - especially when you want the empty fields to be filled by 0 (by using the Value if Null property).
    If the query is changed to ''SELECT DEPTNO, JOB, SAL FROM EMP' , and use the SUM function in the wizard to build the Matrix cell, then the 'Value if Null' property can be used without any issues.
    This also makes Section 25.6 (Add zeroes in place of blanks) of the documentation a joke.
    Anyway, that's my cents worth....

  • WS-SDK Scheduling two instances of the same report with different params

    I'm using the web services SDK for Business Objects XI 3.1 SP 2 to schedule reports. I've got it so that I can successful schedule a report with prompts, setting the value for the prompt and running the report.
    However, I'm now trying to schedule two instances of the same report using a single call to BIPlatform.Schedule. It creates the correct number of new instances, the last of which is completely correct. The first one (and in fact if I do more than two all the rest except the last) lose the parameter value from the prompt and the schedule information and the type. So for example if I schedule two instances, both PDF, both for 8am tomorrow with parameters of 1 and 2, I get:
    A Webi instance, scheduled to run immediately with no parameters specified and
    A PDF instance, scheduled for 8am tomorrow with parameter 2
    Any idea what I'm doing wrong?
    Cheers,
    Jack
    Edited by: Jackson Pope on Feb 3, 2011 1:34 PM

    Can you possibly post your code here that sets params and schedules? Also as you schedule 2 instances on a single report in a sinlgle biplatform.schedule call(): as you query for InfoObject what you actually query for a single report isn't it, or do you schedule a report template and reschdule it previous instance?

  • Displaying a report with 250 000 rows in BI Publisher 11.1.1.6 == very slow

    Hi,
    I try to display a report with 250 000 rows in bi publisher 11.1.1.6.
    Running the SQL Request in TOAD take 20s.
    From bi publisher 11.1.1.6 this operation take more than 2 hour without result.
    The temp file show an xml file which increase (53 M to 70M to 100 M)
    I configure jvm (1.6_029) with the following parameters : Xms512m - Xmx2048 -XX:MaxPermSize=3072m
    My configuration is the following :
    REHL5 64bits
    8G RAM
    100G file system and 50 GB tmp file for bi publisher
    4 CPU
    Jdk Parameters:
    Xms512m -Xmx2048m -XX:MaxPermSize=3072m -XX:UseParallelGC.
    Total CPU usage : 25%
    Live Threads : 85 threads
    Used : 665 Mb
    Commited : 908 Mb
    GC time :
    8.047 s on PS MarkSweep (3 collections)
    8.625 s on PS Scavenge (242 collections)
    Any idea to increase performance or other will be appreciate.
    Thank you
    Mams

    If you are generating a PDF output, select "PDF Compression" option in the properties. Ensure you reduce all the log levels to "Low". Ensure there are no (or minimal) calculations/formulas in the report template.

  • Creating vertical reports with alternating colored rows

    I wanted to create a vertical report with alternating colored rows. Creating a vertical report template was not a problem but I am not able to use different bgcolor for alternating rows.

    As I mentioned above, I used the follwoing code to generate the vertical report BUT i could not get the alternating rows in a diffrent color:
    Before Rows:
    <table class="default2">
    Before Each Row:
    OMIT
    Column Template 1
    <tr><td bgcolor="#CCCC99" width="200"><font color="#336699" #ALIGNMENT#><b> #COLUMN_HEADER#</td> <td width="500">#COLUMN_VALUE#</td></tr>
    Column Template 1 Condition
    Use for Odd rows
    Column Template 1
    <tr><td bgcolor="#CCCC99" width="200"><font color="#336699" #ALIGNMENT#><b> #COLUMN_HEADER#</td> <td bgcolor="#FFFFFF" width="500">#COLUMN_VALUE#</td></tr>
    Column Template 1 Condition
    Use for Even rows
    After Each Row
    OMIT
    After Rows
    </table>

  • How to calculate variance between two dimension values

    Hello:
    I have built a cube in Analytical workspace (9.2.0.5) with 3 dimensions. Time, Product & Scenario. I am using BI Beans (thick client) for the presentation layer. What I need is the ability to calculate the variance between two dimension values of same measure. For example, if My scenarios are 'Actual' and 'Budget', when I present the results on the screen for any measure (e.g Total Sales), I should be able to calculate & display the difference between 'Actual' & 'Budget' values of that measure.
    I have more than 7 scenarios and more than 40 measures. It could even be the difference between two product categories. How do I do it either in AW or at BI Beans Level?
    Thank you very much for your help.
    regards
    Suresh

    You want to look at qualified data references in the OLAP DML references. Basically, any data reference may be qualified by specifying a dimension name and value:
    sales(time 'jan92')
    forces the dimension TIME to the member 'jan92', no matter whether 'jan92' is in status or not. The resulting expression is essentially no longer dimensioned by the dimension TIME.

  • How to Calculate second between two dates?

    I'm wish to create a ref ID using seconds between two dates as the uniue number. I usually use DateDiff function in VB to calculate the ref ID. But now instead developing using VB, i'm using java in developing my project. I wonder is there any class similar to the datediff function? Please advice.Thank you

    diff_sec =( Date1.getSeconds() - Date2.getSeconds());

Maybe you are looking for

  • Can't Connect via XP

    I've just installed my new Airport Extreme N base station and updated both the software and firmware for the unit. I have a sold green light on the front of it, so it appears everything was updated properly. I connect my Mac (this computer) via ether

  • Can't see external HDD while wanting to restore

    I just had to restore my Mac, and luckily I backed up to a Ex HDD with Time Machine, but now I'm trying to restore it I've had nothing but problems. Cmd+R gives me: No full system backups Migration Assistant: Can't see drive Setup: Can't see drive I'

  • JS CS3 Page Item Dimensions

    Hi there I'd like to change the width & height of a rectangle by certain increment. This can be easily done by manipulating geometricBounds. However when the rotationAngle is other than zero everything goes off the rails. I tried experimenting with h

  • Contribute as a CMS help

    I'm having difficulties finding a trial version of the CPS software or any related info on Adobe's site. I have contribute CS4 and would like to evaluate a solution where others can edit sections of my website in a browser. I thought contribute enabl

  • How to use pdf files inside swf

    Hallo. I need a little help. I need to load pdf file inside my swf. I can just open a new browser page and load there my pdf file but first i go outside my swf and second users have to get adobe reader in order to read files. Is there a way to load a