Subtotal issue when subtotaling on a calc field built using CASE function

Okay, I hpe I can explain this well. May be possible that this is something cannot handle in Discoverer. I am using Discoverer Plus to develop a new workbook - cross project expenditure inquiry. A requirement is to not allow a worksheet user to see labor cost (since possible to figure out someone's salary) amount unless they are allowed to view labor cost. I have a function that returns a Y/N value that tells me if they can view labor cost. That works out just fine. So what I am doing is taking my database cost column (which is defined as Number(22,5) in the Oracle table. I create a new calculated column, basically like this -
CASE WHEN expenditure type <> LABOR THEN cost WHEN view labor cost = 'Y' THEN cost ELSE NULL END.
That calculated column is working just fine. I am seeing my desired results in that column. Okay so far.
Next, the users want subtotals by project organization and project. So I created a new total. When I did that, my subtotal row amount is blank.
Okay, I have seen this happen with NULLS before. Like in the gl_je_lines tables, where the accounted_Dr and accounted_Cr may be null, and have to do a NVL function to convert the null to 0 and allow me to subtotal on the column in a Discoverer workbook.
So I tried creating a second calculation -
NVL(Cost,0)
So I return the cost if not null, otherwise I return 0. Second calc column results look okay.
Now I did a subtotal on the second calculation. Oops. Wrong result. Amount is shown as 0.
For grins, I went back to my CASE statement on my first calculation and changed the ELSE condtion from NULL to 0. When I did that, the subtotal on that column changes from a blank (Null) value to a 0 value. Well, better, but still just like my second calculation subtotal.
Obviously the users have the option to export to Excel and subtotal in Excel.
Does anyone know of a way to get a good subtotal in this kind of situation, where I am attempting to subtotal on a calculated field that is built on a CASE function? Or am I out of luck when it comes to Discoverer?
John Dickey

Okay, I did find a workaround, though I do not understand why the workaround works, but why the way I first tried to get a subtotal did not work. What I did is that I had to go to Discoverer Administrator. I picked my folder and did an Insert/Item. I created my new item building the same CASE statement that I used in my worksheet to create a new calculation. I then closed Discoverer Plus and reopened Discoverer Plus. Opened my worksheet. Edited the worksheet and brought in my new (derived) item from my folder. Then I created my subtotals for this secured cost amount. Voila. I get a number now, and the subtotal amount appears to be correct (still testing/verifying, but looks okay so far). So I deleted my subtotals on my calculated column and then deleted the calculation, to get that stuff out of the report. Sure would be nice if there was documentation in the Discoverer manuals about this.
John Dickey

Similar Messages

  • When I get a date field value using the Oracle thin (type 4) JDBC driver...

    ....in 'DD-MMM-YY' format from an Oracle 8i database and pass it in to the java.util.Date() constructor, I get a IllegalArgumentException. This error doesn't occur when I use the type 2 driver, so it is apparently a driver-specific thing. It happens on both Win32 and Linux.
    Has anyone seen this before? Is there a newer version of the Oracle thin (i.e., type 4) driver than is listed here?
    http://web77-02.us.oracle.com/software/tech/java/sqlj_jdbc/content.html
    Thanks,
    Tom
    [email protected]

    Yup, that original post didn't make much sense, did it? Let's try again.
    I've got an EJB app that runs on WebLogic 6.0 (on Solaris in production, on Win2K for development) and accesses an Oracle 8i database. This app currently uses the Oracle type 2 JDBC drivers. All is well.
    So I wanted to see how it would run on Linux. I've got a Redhat 7.1 box handy, so I installed the JDK and WL6.0 and slapped the ear file on there. Problem! Can't deploy because there are no Oracle drivers on this machine!
    Makes sense. So I started looking around, and it seems installing Oracle on a RH 7.1 box involves patching glibc and other such nastiness. So let's just try the type 4 JDBC driver - no glibc patch, no shared object libraries, just good 'ol pure Java talking to Oracle on port 1521.
    Once I had the URLs and whatnot set up, the app connected to the DB just fine, created the connection pool, read some data, etc. But when my app read a date from the DB and instantiates a new java.util.Date object, I got an IllegalArgumentException - i.e., the date can't be parsed.
    "Hmm... that's odd", I thought, so back I went to my trusty Win2K machine, modified my configuration files to use the type 4 driver and - same error! So I switched back to the type 2 driver - and everything works fine, Dates and all. Hmmm.....
    As you correctly state, that Date constructor is deprecated and I should use DateFormats and GregorianCalendars and whatnot instead.
    But has anyone seen this weird behavior before - code that works fine on a type 2 driver starts throwing exceptions when used with a type 4 driver? Anyone have any solutions?
    Thanks much,
    Tom

  • Issues when we try to lookup for EJB using T3 protocol

    Hi,
    We have EJB's deployed in Weblogic server and we are trying to invoke them using T3 protocol.
    We are facing problem as its giving the following exception
    javax.naming.CommunicationException [Root exception is java.net.ConnectException: t3://170.0.10.45:7685: Bootstrap to dev2.test.zone/170.0.10.45:7685 failed. It is likely that the remote side declared peer gone on this JVM];
    We tried to enable HttpTunneling in Weblogic server but it did not work.
    Could anyone suggest solution for this at the earliest. Not sure whether this is a cluster issue .

    We are trying to connect to service and EJB from our local weblogic portal
    Client Server Info
    Weblogic version 9.2
    jdk1.5
    Server Info
    Weblogic version 9.2
    jdk1.5
    In properties file we have delcared the EJB client URL : t3://IP:7685
    code
    private static final String CLIENT_EJB_KEY_PREFIX = "ejbclient.";
    private static final String CLIENT_EJB_JNDI_NAME_SUFFIX = ".remoteJndiName";
    try {
    String className = cls.getName();
    String key = CLIENT_EJB_KEY_PREFIX + className + CLIENT_EJB_JNDI_NAME_SUFFIX;
    LOG.debug("Looked up key of {} for className: {}", key, className);
    String jndiName = cfg.getString(key);
    System.out.println("Inside getHome Method : Jndi Name"+jndiName);
    if (StringUtils.isEmpty(jndiName)) {
    System.out.println("Inside if");
    throw new ServiceNotAvailableException("Unable to locate JNDI key of %s for class %s", key, className);
    Hashtable<String, String> env = new Hashtable<String, String>();
    env.putAll(context.connectionEnv());
    Context ctx = new InitialContext(env);
    EJBHome home = (EJBHome) ctx.lookup(jndiName);
    return home;
    } catch (NamingException cause) {
    throw new ServiceNotAvailableException(cause);
    The call to EJB is failing because it is not able to communicate using T3 protocol.

  • Efficemcy question: Add a field or use a function

    I have a table with information about employees. Each empl receives a salary and I need to show the cumulated salaries over a period of time - for every employee.
    so imagine this, every time you ignite the program you see a list of empls (100+) and their cumulated salaries.
    Question: Should I add a column cumulatedSalary to the table (and every time an empl recieves a salary - add it to the comulted field) or simply to use the SQL aggregate function to sum up all empl's salary.
    What is more efficient?

    Keep a table of employee information including their id.
    Keep a separate table with the minimum of the employee id, salary paid and the date of the check was issued.
    When you want to show the employee�s salary sum the records over the date range applicable. Use a join and compute the sum at the database level.
    Efficiency should only be one of your concerns.
    rykk

  • Windows media player crash dumps when i try to play songs or use most functions i.e. drag and drop,

    I've been trying to download music from Amazon to my MP3 player.  It successfully downloads to my computer, but when I try to do anything in Windows Media Player, I get the crash dump screen.  I have, somehow, been able to download some music to the player, but now almost every time the Windows Media Player crashes.  Help!

    Did you copy the songs directly from a CD or did you download the files from a website?
    You can use a different player than the Windows Media Player to play the songs if you copied them from a CD to avoid that.

  • Issue while generating Field catalog using LVC_VARIANT_SELECT

    Hello Folks,
      When i passed the default field catalog to the function module LVC_VARIANT_SELECT... for which the field name that is passed is standard field and the table name i was passing is Internal table ( Which is mandatory for my Req). As i am not passing the table name that exists at the DB level to the default field catalog .. this function module LVC_VARIANT_SELECT is returning all the field types as CHAR ( Irrespective of the field). This is causing me a problem in calculating totals ( standard functionality - throwing me message 'Column cannot be calculated' ) in my ALV_tree.
      I have to use the Function Module LVC_VARIANT_SELECT ( Since i have a variant logic associated) and the Internal table to generate the field catalog .and i want  to achieve the functionality of total,Avg ,,,,etc.. Any idea is appreciated.

    Got the Solution ... Passes Ref-table and Ref-field ... it gives totals for currency and quantity fields

  • RWCLIENT issue when passing parameters with spaces

    AS 10.2.0.2 on Sun Solaris 10. We have reports that are scheduled and sum of the parameters have spaces in the value. For example parm1=I am with spaces. We would then generate a command line that shows the parameter like rwclient.sh server=rep_serv report=report1 parm1=I am with spaces. This errors with numerous messages. I tried surrounding the value in single quotes like this rwclient.sh server=rep_serv report=report1 parm1='I am with spaces'. When running the quoted command the report server shows the parameter as parm1='I' am with spaces. We have the parameter page of the report as the first page which allows us to see what was actually used as parameters. Of course the data in the database has no value that matches with the single quotes so no data. I need to be able to pass a value with spaces and it actually show as a parameter with spaces. We do not have this issue when we can run with forms built-ins as you actually build a parameter list to pass. Thanks in advance.
    Edited by: gdaustin1 on Jan 26, 2012 8:03 AM

    It's a bit of both I guess. On a command line a space is used to separate switches and variables. Like this demo.bat:
    @echo off
    echo %1Results in:
    C:\Temp>demo.bat Hello World
    Hello
    C:\Temp>demo.bat "Hello World"
    "Hello World"If you want to remove the double quotes, you have to change your source code to:
    @echo off
    echo %~1Now you get:
    C:\Temp>demo.bat "Hello World"
    Hello World

  • Issue loading ODS having single Data field when it is set to "No Updpate"

    Hi Gurus,
    I have a standard ODS object with 6 Keyfields & 1 Datafield.
    I am updating it from an Infosouce with help of Update Rules.
    In the Update rules:
    The 6 Keyfields are mapped from the Infosource fields which has relevant data.
    The one Data field needs to be set to "No Update" because there is no relevant field from the Infosource.
    Issue is surfacing with this Data field being set to "No Update"
    when I run the Infopackage even though there are relevant fields in Infosource for the 6 Keyfields none of them are getting updated.
    But when I set the Data field to "Overwrite" and for Update method give some constant or write some Routine and give the Result as 0, the rest 6 Keyfields are also getting updated from the Info source.
    My question is....
    If ODS is having only one Data field, is it mandatory that I have to update it with some value ?
    Can't I set it to "No Update" and load just the Key fields ?
    Thanks in advance,
    Venkat

    Thanks for the inputs.
    Even I had to agree if there is only one Data field in the ODS I have to set to some kind of Update...
    But.....I couldn't find it in writing (in  document) no where from the Web.
    Could anyone point out a document which confirms/explains this ?
    Thanks,

  • OBIEE 11g - issue when export hierarchy to a csv

    Hello,
    I have an issue when I try to export to a csv file a report containing a Logical Dimension field, when I export just the first level of hierarchy is exported and not all the records. When I export to another format (such as excel) all the records are exported correctly. Do you know what can I do in order to have all the records exported to a csv?
    Thanks!
    Solange.

    This is a bug see below.
    Bug 13083479 : EXPORT DATA TO CSV FORMAT DOES NOT DOWNLOAD EXPANDED HIERARCHICAL COLUMNS
    Proposed workaround : OBIEE 11.1.1.5: Pivot Table Report Export To Csv Does Not Include Hierarchical Data [ID 1382184.1]
    Mark if answered.!
    Thanks,
    SVS

  • Issue with Supplier site descriptive flex field upgrade from 11i to R12

    We ran into some issue when upgrade Supplier site descriptive flex field from 11i to R12.
    In 11i. we defined descriptive field on JG_PO_VENDOR_SITES. in the segment definition, we defined one of the attributes default value based on Form Field Value, and the statement is like this:
    SELECT decode(:SITE.COUNTRY,'IT','AP ITALIAN TRANSACTIONS','AP AUTOFATTURA') FROM dual
    All above worked fine in 11i, whenever the flexfield field is open in forms, the default valuse shows based on the real-time value in :SITE.COUNTRY.
    In R12, Supplier site management is in HTML format. There is no forms, which means no form value. Do you have an alternative soluction for implement the same logic in R12?
    Thank you and regards,
    Kate
    Edited by: user12100435 on Feb 12, 2013 9:06 AM

    Kate,
    Have you logged a SR and see if Oracle support can help?
    Thanks,
    Hussein

  • Urgent help - PO issue when receiving

    Dear gurus
    i have an urgent production issue, i have done a mass conversion of all the master data from one plant to another, the scenario is that they are closing down and stopping operations at old plant and moving the entire operations to new plant under the same company code, so for this i did the entire MM master data conversions
    i also changed the delivering plant and address using MASS T-code for all the open PO's line items from old plant to new plant (some of line items had partial open qty and some of them entire open qty)
    <b><u>1st issue:</u></b>
    But when i am doing VL31N inbound delivery, the PO qty is NOT showing up automatically in the delivery qty field, so it is causing issues when trying the do a GR
    <b><u>2nd issue</u></b>
    also another issue is that in the Goods Movement Data tab while using VL31N for GR, it is by default showing the old plant still and is grayed out even though the PO line item contains the new plant code and delivery address, so how can we change the receiving plant to new plant and why it is not picking the new plant still
    so can you please help me on this issue and let me know if there is any settings or resolution
    thanks a lot in advance and appreciate your expert advices
    chakri

    dear chakri,
    you have written that you have converted the material master data, but what about the existing puchase orders, you have to copy all the orders in the new plant .
    or if possible try to chane the delivery address in in the item details of the P.O.
    rewards if useful.
    ashish

  • Date issue when exporting data to Excel from SSRS report, where date is less than 1/1/1900

    Hi,
    I am using SSRS report to display the data from database. In that data, One of the column is DATE. when I am exporting to Excel all that dates are displaying fine except 1/1/1800 12:00 AM. Instead of 1/1/1800 12:00 AM it is displaying XXXXXXXXXXXXXX values.
    Please help me to fix the issue.
    Please let me know if more clarification required.
    Thanks In advance.

    Hello,
    We can use Cstr() function to convert the Date type data to String data. Suppose we have a field named DateTime, please refer to the expression below:
    =Cstr(Fields!DateTime.Value)
    Then we can get a string type data. There is an article about SSRS expression, you can refer to it.
    http://msdn.microsoft.com/en-us/library/ms157328.aspx
    If you have any questions, please feel free to let me know.
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • Issue when Calling the RFC from external system

    Hi,
    I have created one RFC, in which I am using one function module to get the material customer status.
    Functional Module name is "QC01_BATCH_VALUES_READ".
    When I run this in SAP, it is giving a value for Cusotmer Status. But when this RFC is called from .Net system it is not returning any value for this field.
    Even I used a different function module 'CLAF_CLASSIFICATION_OF_OBJECTS' for the same, in this also in SAP it is doing good, but when it is called from .Net, the program is giving dump.
    Please help me to resolve this issue
    Thanks
    Ravi

    Hi Ravi,
    Issue can be either in the .NET program or in the RFC destination creation.
    1)
    Check whether data types of .NET program which is calling the SAP function module are correct. 
    If there are issues with data types,  program dont report if you dont so explicitly.
    2) Check whether RFC destination you are giving in your .NET program is correctly configured in
        SAP , verify by testing the same.
    Apart from above two reasons, I dont see any other major reasons for not getting correct results.
    Regards
    Krishna

  • Issue when "AT NEW " or "AT END OF " is executed

    Hi,
    I face an issue, when "AT NEW <>" or "AT END OF <>" line gets executed: the loop structure which fetches record from internal table, gets reset every time when either of above two statements are executed. But, whenever loop is called and the structure gets assigned with value, it seems to be fine. Only when above two statements are executed, the problem is introduced. I checked it in debug mode. Not sure on how to solve it. please help.
    Thanks,
    Gaurav.

    Hi,
    When the AT NEW or AT END command get executed in that time the structure which toy are using will make all the fields * other except the field on which you do the AT NEW or AT END.
    Hence you need to pass that structure values to the another structure before the AT NEW and AT END and use that structure in the AT NEW and AT END so ypu will get all the values inside these functions.
    loop at t_temp to lw_temp.
    lw_temp1 = lw_temp.
    AT NEW field name
    Lw_temp =lw_temp1.
    ENDAT.
    ENDLOOP

  • Parition issue when selecting from the main table

    I have a partitioned table where i jsut did a partition
    exchange with another temp table.
    when I query the partition it looks good, i.e. the data is there, but when I query the data directly
    on the table no rows are returned.
    for example
    select count(*)
    from sales partition (2007)
    12455
    select count(*)
    from sales
    where year = 2007
    0 rows
    I've reviewed the parition 2007 and esnured the 'where year = ' clause is accurate via previous years.
    why am i not seeing this data in the second query?
    db = 10G R2
    thanks

    create table SALES
    nologging
    parallel
    partition by range (year,fscl_period,channel)
    PARTITION p_200701_5 values less than (2008,200702,6) TABLESPACE SALES_2007_DATA,
    PARTITION p_200701_6 values less than (2008,200702,7) TABLESPACE SALES_2007_DATA,
    PARTITION p_200701_7 values less than (2008,200702,8) TABLESPACE SALES_2007_DATA,
    PARTITION p_200701_8 values less than (2008,200702,9) TABLESPACE SALES_2007_DATA,
    PARTITION p_200701_9 values less than (2008,200702,10) TABLESPACE SALES_2007_DATA,
    PARTITION p_200701_10 values less than (2008,200702,11) TABLESPACE SALES_2007_DATA,
    PARTITION p_200701_11 values less than (2008,200702,12) TABLESPACE SALES_2007_DATA,
    PARTITION p_200701_12 values less than (2008,200702,13) TABLESPACE SALES_2007_DATA,
    PARTITION p_200701_13 values less than (2008,200702,14) TABLESPACE SALES_2007_DATA,
    PARTITION p_200702_5 values less than (2008,200703,6) TABLESPACE SALES_2007_DATA,
    as select * from table...
    note: year,fscl_period,channel are all NUMBER datatype.
    Fiscal period is month bascially
    I am wondering if doing this all this in a range partition, and not a range/list which channel may be better qualified for data wise, is the issue. Or perhaps range by year, sub by month, then list by channel. What will the impact be either way?
    Interestingly, the data will come back on a star query i.e. when the SALES table is joined to the calendar_dim (via a day_id field) and use the 2007 predicate from the calendar_dim rather than the one on SALES (the one used for the part. definition).
    Also, i did the partition exchange originally with the novalidation option. We tried again without that and the exchange failed saying some data doesn't qualify. But reviewing the data it appears it all should.
    We then just did a giant insert statement and it all went through, but i have not had teh chance to validate what partitions the data live in now.
    thanks for any help.
    jeff
    Message was edited by:
    jeffs

Maybe you are looking for

  • How do I modify the size limitation on images in PSE 12?

      I frequently use panorama tools in Photoshop CS6 & CC and PSE 12 to generate large images (several sunsets/sunrises reach as much as 370 MB or more --- PNG or TIF without layers).  It apears that PSE 12 (and previous) have a limit less than a tenth

  • Can't get dictation to work on my IMAC with ML

    I have Mountain Lion up and working on my '09 Imac, and it shows dictation icon, etc but can't get it to show text in messages or in mail. Any ideas?

  • Seeing iTunes library from MacPro with ethernet only

    I upgraded from an Apple TV 1st Generation so I could use Netflix.  I've managed to successfully set up home sharing with my MacBook Pro, but it is not seeing the content on my MacPro. This does not have a wi-fi card, but is connected to a wi-fi rout

  • G5 leopard doesn't recognize airport network

    airport utility, network diagnostics, and other ways to try to get my G5 to recognize my network don't work. my MAcBook pro is setting on the same desk and has no trouble. thanks in advance for any help.

  • Need to open an ABAP WebDynpro application from Portal UWL work item

    Hi All I need some suggessions on how to navigate to an ABAP WebDynpo application iview from a mail(Work Item) in portal UWL. Requirement in detail: Agreements will be created from portal( Agreement Creation Application is developed in ABAP webDynpro