Group By with nested calculations

Hi Gurus,
I have an Acct table with the follwig fields
Bal_date
Bal_amt
Acc_No
I want to calculate the average balance based on this formula:
Average=Amount * no_of_days/no_of_days_in_month
Where amount= Bal_amt (i.e. daily balance)
no_of_days = number of days the account has been holding that amount
Calculation for average negatives is done and reported separately
For instance if account 123456 has the following balance history:
01-JAN-09 to 08-JAN-09 = 1000
09-JAN-09 to 21-JAN-09 = -2000
22-JAN-09 to 31-JAN-09 = 3000
For Positive_Average = (1000*8/31)+(3000*10/31)
=258.06 + 967.74 = 1225.81
Calculation for negative:
     (-2000*13/31) = -838.71
I have used a case to separate positive balances from negative balances
I want the output like this
ACC_NO          AVG_AMT          POS_NEG_MARKER
123456          1225.81          1
123456          838.71          0
The negative balance is reported in its absolute form so I have a marker that checks if bal was -ve then 0 else 1
My Approach:
select Acc_No,
sum((AVG(Bal_amt)*(((max(Bal_date)-min(bal_date))/to_char(last_day(ab_date),'DD'))))),
(case when Bal_amt < 0 then '0' else '1' end) as POS_NEG_MARKER
from ACCT
Where Bal_date between '01-JAN-09' and '31-JAN-09'
Group by Acc_No, (case when Bal_amt < 0 then '0' else '1' )
This definitely thows the ORA-00937: not a single-group group function and if I play with the select elements I get ORA-00979: not a GROUP BY expression
I am sure there is a better way to handle this requirement. Please assist with ideas and corrections where necessary.
Thanx in advance

Your welcome. How do you want the query to behave when you have a zero balance? An extra record?
What the sign () does is return a 1, 0, -1 depending on whether the value is positive, zero or negative.
SQL> select val, sign (val)
  2    from (select 100 val from dual
  3          union all
  4          select 0 from dual
  5          union all
  6          select -123 from dual
  7  )
  8  /
       VAL  SIGN(VAL)
       100          1
         0          0
      -123         -1you could do something like this:
SQL> select acc_no
  2       , round (abs (sum (case when ind = 1
  3              then pos_amt
  4              when ind = -1
  5              then neg_amt
  6              else 0
  7              end * no_of_days/days_in_month
  8             )), 2) avg_amt
  9       , greatest (ind, 0) pos_neg_marker
10    from (
11  select decode (sign (bal_amt), 1, bal_amt) pos_amt
12       , decode (sign (bal_amt), -1, bal_amt) neg_amt
13       , decode (sign (bal_amt), 0, bal_amt) zero_amt
14       , sign (bal_amt) ind
15       , acc_no
16       , lead (bal_date, 1, last_day (bal_date))
17                  over (partition by acc_no
18                            order by bal_date
19                       ) - bal_date no_of_days
20       , last_day (bal_date) - trunc (bal_date, 'MM') + 1 days_in_month
21    from test
22  )
23   group by acc_no, ind
24  /
    ACC_NO    AVG_AMT POS_NEG_MARKER
         1          0              0
         1    1129.03              1
         1      387.1              0

Similar Messages

  • Photoshop CS5 - Compatibility issue with nested groups

    I'm using Photoshop CS5 to create a multi-layered, group-heavy PSD. The final file is intended for public consumption, so, ideally, I'd like it to be accessible to as many users - and therefore compatible with as many versions of Photoshop - as possible.
    However, I just tried to save the file, and was prompted with this message:
    This document contains nested layer groups that may change in apprearance if opened in applications older than Photoshop CS5.
    Opening the file in CS4 after the save confirmed that a few of the layer groups were indeed corrupt.
    Can anyone shed any light on this?

    It looks like you're the only person so far who's posted that particular message on the web anywhere!
    Out of curiosity, do you have the Maximize PSD and PSB File Compatibility option set to Always in Edit - Preferences - File Handling?
    I have no experience with nested groups, myself, but that setting comes to mind as being involved with the kind of compatibility you're hoping to accomplish.
    I do know that nested group capabilities have been around since at least Photoshop CS2.
    -Noel

  • Is there a way (script option, exporter option) to export a .psd/.psb file with nested layersets to another layered .psd file with a flat layer structure for greater compatibility? (i.e. CS6/CC/CC '14 to CS4 or older?)

    Just looking for a solution short of having to go in and manually delve through hundreds of layers and reorganize the .psd.  There's a lot of vector elements, layer effects and blending modes as well.  It'd be nice to see Adobe include an exporter for older Photoshop versions that can take a newer file and regenerate it making whatever necessary changes to maintain compatibility across older Photoshop versions and even for cross-compatibility.  I know that's not necessarily in their best interests for additional sales, but it is in the end-user's best interests when they collaborate with others across various file and application formats.

    The first problem here is Layer Styles, if I understand what you are trying to do correctly. You can have arbitrarily nested Layer Sets/Groups (each with its own Layer Style) that contain Layers with their own Layer Styles. This means that for a nested layer, you would have to take it's Layer Style and merge it with the containing Group(s) layer styles in the correct order. Then you have to do the same thing with Layer/Vector Masks and whatever else is involved. It's a non-trivial piece of work. It's not intractable, however.
    There is also the problem that some parts of the Layer Styles are binary blobs that make merging at the JS level impossible.
    If someone has implemented this, I would love to see the implementation.
    What you actually need may be a lot less complicated than the general case. If so, you may be able to find someone to help you out.
    I wish you luck.

  • Analytical Services failed to get user's parent group tree with Error

    Hi,
    We have a frequent errror during our weekly batch for an application.
    The context:
    - Essbase Administration Services we are using is version is 9.3.1.
    - 8 applications are calculated during the week-end. The scripts executed are exactly the same for the 8 applications.
    - For example let's say that 5 scripts are launched during the night in the batch for each application (script 1, script 2 ... script 5)
    - App1 and App2 are launched alone and before the 6 others applications as these applications database are 3 x bigger (App1 is calculated alone, then app2 is calculated alone, then app3 to app8 scripts are launched in the same time).
    The issue :
    - We don't see any issue for app3 to app8, the calculation are executed without any problem from script1 to script5.
    - But we have an error in App1 and App2 log when the bath execute script 4 and we see the following error in the server log **
    "Analytical Services failed to get user's parent group tree with Error".
    (** : we don't see any log for script 4 in the application log - it's like the server bypass script 4 to go directly from script 3 to script 5 )
    Nothing special is done in script 4 but just an aggregation of the Year dimension (using a @SUM(@RELATIVE(Year,0)) calculation.
    I think that there is may be a synchronization error with Shared Services but what is strange is that it's always for the same script 4 and the batch is launched at different time every week-end.
    Can the issue be linked to the size of the database of applications (8 Gb) and difficulties for the processor to executes aggregation in a large database volume ?

    Hi,
    According to your description, my understanding is that the error occurred when sending an email to the user in workflow.
    Did you delete the existing Connections before setting NetBiosDomainNamesEnabled?
    If not, I recommend to delete and recreate your AD connections, then set NetBiosDomainNamesEnabled to true.
    Or you can delete the original User Profile Service Application and create a new one, then set the NetBiosDomainNamesEnabled to true and start the User Profile Service Application
     synchronization.
    More reference:
    http://social.technet.microsoft.com/wiki/contents/articles/18060.sharepoint-20xx-what-if-the-domain-netbios-name-is-different-than-the-fqdn-of-the-domain-with-user-profile.aspx
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Query rewrites with Nested materialized views with different aggregations

    Platform used : Oracle 11g.
    Here is a simple fact table (with measures m1,m2) and dimensions (a) Location (b) Calendar and (c) Product. The business problem is that aggregation operator for measure m1,m2 are different along location dimension and Calendar dimension. The intention is to preaggregate the measures for a product along the calendar dimension and Location dimension and store it as materialized views.
    The direct option is to define a materialized view with Inline queries (Because of the different aggrergation operator, it is not possible to write a query without Inline query). http://download-uk.oracle.com/docs/cd/B28359_01/server.111/b28313/qradv.htm#BABEAJBF documents the limitations that it works only for 'Text match' and 'Equivalent queries' and that is too limiting.
    So decided to have nested materialized view, with first view having just joins(my_dim_mvw_joins), the second view having aggregations along Calendar dimension (my_dim_mvw_calendar) and third view having aggregations along the Location dimension(my_dim_mvw_location). Obviously I do not want the query I fire to know about materialized views and I fire it against the fact table. I see that for the fired query (Which needs aggregations along both Calendar and Location), is rewritten with just second materialized view but not the third. (Had set QUERY_REWRITE_INTEGRITY as TRUSTED) .
    Wanted to know whether there are limitations on Query Writes with nested materialized views? Thanks
    (Have given a simple testable example below. Pls ignore the values given in 'CALENDAR_IDs', 'PRODUCT_IDs' etc as they are the same for all the queries)
    -- Calendar hierarchy table
    CREATE TABLE CALENDAR_HIERARCHY_TREE
    (     "CALENDAR_ID" NUMBER(5,0) NOT NULL ENABLE,
    "HIERARCHY1_ID" NUMBER(5,0),
    "HIERARCHY2_ID" NUMBER(5,0),
    "HIERARCHY3_ID" NUMBER(5,0),
    "HIERARCHY4_ID" NUMBER(5,0),
    CONSTRAINT "CALENDAR_HIERARCHY_TREE_PK" PRIMARY KEY ("CALENDAR_ID")
    -- Location hierarchy table
    CREATE TABLE LOCATION_HIERARCHY_TREE
    (     "LOCATION_ID" NUMBER(3,0) NOT NULL ENABLE,
    "HIERARCHY1_ID" NUMBER(3,0),
    "HIERARCHY2_ID" NUMBER(3,0),
    "HIERARCHY3_ID" NUMBER(3,0),
    "HIERARCHY4_ID" NUMBER(3,0),
    CONSTRAINT "LOCATION_HIERARCHY_TREE_PK" PRIMARY KEY ("LOCATION_ID")
    -- Product hierarchy table
    CREATE TABLE PRODUCT_HIERARCHY_TREE
    (     "PRODUCT_ID" NUMBER(3,0) NOT NULL ENABLE,
         "HIERARCHY1_ID" NUMBER(3,0),
         "HIERARCHY2_ID" NUMBER(3,0),
         "HIERARCHY3_ID" NUMBER(3,0),
         "HIERARCHY4_ID" NUMBER(3,0),
         "HIERARCHY5_ID" NUMBER(3,0),
         "HIERARCHY6_ID" NUMBER(3,0),
         CONSTRAINT "PRODUCT_HIERARCHY_TREE_PK" PRIMARY KEY ("PRODUCT_ID")
    -- Fact table
    CREATE TABLE RETAILER_SALES_TBL
    (     "PRODUCT_ID" NUMBER,
    "PRODUCT_KEY" VARCHAR2(50 BYTE),
    "PLAN_ID" NUMBER,
    "PLAN_PERIOD_ID" NUMBER,
    "PERIOD_ID" NUMBER(5,0),
    "M1" NUMBER,
    "M2" NUMBER,
    "M3" NUMBER,
    "M4" NUMBER,
    "M5" NUMBER,
    "M6" NUMBER,
    "M7" NUMBER,
    "M8" NUMBER,
    "LOCATION_ID" NUMBER(3,0),
    "M9" NUMBER,
    CONSTRAINT "RETAILER_SALES_TBL_LOCATI_FK1" FOREIGN KEY ("LOCATION_ID")
    REFERENCES LOCATION_HIERARCHY_TREE ("LOCATION_ID") ENABLE,
    CONSTRAINT "RETAILER_SALES_TBL_PRODUC_FK1" FOREIGN KEY ("PRODUCT_ID")
    REFERENCES PRODUCT_HIERARCHY_TREE ("PRODUCT_ID") ENABLE,
    CONSTRAINT "RETAILER_SALES_TBL_CALEND_FK1" FOREIGN KEY ("PERIOD_ID")
    REFERENCES CALENDAR_HIERARCHY_TREE ("CALENDAR_ID") ENABLE
    -- Location dimension definition to promote query rewrite
    create DIMENSION LOCATION_DIM
    LEVEL CHAIN IS LOCATION_HIERARCHY_TREE.HIERARCHY1_ID
    LEVEL CONSUMER_SEGMENT IS LOCATION_HIERARCHY_TREE.HIERARCHY3_ID
    LEVEL STORE IS LOCATION_HIERARCHY_TREE.LOCATION_ID
    LEVEL TRADING_AREA IS LOCATION_HIERARCHY_TREE.HIERARCHY2_ID
    HIERARCHY PROD_ROLLUP (
    STORE CHILD OF
    CONSUMER_SEGMENT CHILD OF
    TRADING_AREA CHILD OF
    CHAIN
    -- Calendar dimension definition
    create DIMENSION CALENDAR_DIM
    LEVEL MONTH IS CALENDAR_HIERARCHY_TREE.HIERARCHY3_ID
    LEVEL QUARTER IS CALENDAR_HIERARCHY_TREE.HIERARCHY2_ID
    LEVEL WEEK IS CALENDAR_HIERARCHY_TREE.CALENDAR_ID
    LEVEL YEAR IS CALENDAR_HIERARCHY_TREE.HIERARCHY1_ID
    HIERARCHY CALENDAR_ROLLUP (
    WEEK CHILD OF
    MONTH CHILD OF
    QUARTER CHILD OF
    YEAR
    -- Materialized view with just joins needed for other views
    CREATE MATERIALIZED VIEW my_dim_mvw_joins build immediate refresh complete enable query rewrite as
    select product_id, lht.HIERARCHY1_ID, lht.HIERARCHY2_ID, lht.HIERARCHY3_ID, lht.location_id, cht.HIERARCHY1_ID year,
    cht.HIERARCHY2_ID quarter, cht.HIERARCHY3_ID month, cht.calendar_id week, m1, m3, m7, m9
    from retailer_sales_tbl RS, calendar_hierarchy_tree cht, location_hierarchy_tree lht
    WHERE RS.period_id = cht.CALENDAR_ID
    and RS.location_id = lht.location_id
    and cht.CALENDAR_ID in (10,236,237,238,239,608,609,610,611,612,613,614,615,616,617,618,619,1426,1427,1428,1429,1430,1431,1432,1433,1434,1435,1436,1437,1438,1439,1440,1441,1442,1443,1444,1445,1446,1447,1448,1449,1450,1451,1452,1453,1454,1455,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1476,1477)
    AND product_id IN (5, 6, 7, 8, 11, 12, 13, 14, 17, 18, 19, 20)
    AND lht.location_id IN (2, 3, 11, 12, 13, 14, 15, 4, 16, 17, 18, 19, 20)
    -- Materialized view which aggregate along calendar dimension
    CREATE MATERIALIZED VIEW my_dim_mvw_calendar build immediate refresh complete enable query rewrite as
    select product_id, HIERARCHY1_ID , HIERARCHY2_ID , HIERARCHY3_ID ,location_id, year, quarter, month, week,
    sum(m1) m1_total, sum(m3) m3_total, sum(m7) m7_total, sum(m9) m9_total,
    GROUPING_ID(product_id, location_id, year, quarter, month, week) dim_mvw_gid
    from my_dim_mvw_joins
    GROUP BY product_id, HIERARCHY1_ID , HIERARCHY2_ID , HIERARCHY3_ID , location_id,
    rollup (year, quarter, month, week);
    -- Materialized view which aggregate along Location dimension
    CREATE MATERIALIZED VIEW my_dim_mvw_location build immediate refresh complete enable query rewrite as
    select product_id, year, quarter, month, week, HIERARCHY1_ID, HIERARCHY2_ID, HIERARCHY3_ID, location_id,
    sum(m1_total) m1_total_1, sum(m3_total) m3_total_1, sum(m7_total) m7_total_1, sum(m9_total) m9_total_1,
    GROUPING_ID(product_id, HIERARCHY1_ID, HIERARCHY2_ID, HIERARCHY3_ID, location_id, year, quarter, month, week) dim_mvw_gid
    from my_dim_mvw_calendar
    GROUP BY product_id, year, quarter, month, week,
    rollup (HIERARCHY1_ID, HIERARCHY2_ID, HIERARCHY3_ID, location_id)
    -- SQL Query Fired (for simplicity have used SUM as aggregation operator for both, but they will be different)
    select product_id, year, HIERARCHY1_ID, HIERARCHY2_ID,
    sum(m1_total) m1_total_1, sum(m3_total) m3_total_1, sum(m7_total) m7_total_1, sum(m9_total) m9_total_1
    from
    select product_id, HIERARCHY1_ID , HIERARCHY2_ID , year,
    sum(m1) m1_total, sum(m3) m3_total, sum(m7) m7_total, sum(m9) m9_total
    from
    select product_id, lht.HIERARCHY1_ID , lht.HIERARCHY2_ID , lht.HIERARCHY3_ID ,lht.location_id, cht.HIERARCHY1_ID year, cht.HIERARCHY2_ID quarter, cht.HIERARCHY3_ID month, cht.calendar_id week,m1,m3,m7,m9
    from
    retailer_sales_tbl RS, calendar_hierarchy_tree cht, location_hierarchy_tree lht
    WHERE RS.period_id = cht.CALENDAR_ID
    and RS.location_id = lht.location_id
    and cht.CALENDAR_ID in (10,236,237,238,239,608,609,610,611,612,613,614,615,616,617,618,619,1426,1427,1428,1429,1430,1431,1432,1433,1434,1435,1436,1437,1438,1439,1440,1441,1442,1443,1444,1445,1446,1447,1448,1449,1450,1451,1452,1453,1454,1455,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1476,1477)
    AND product_id IN (5, 6, 7, 8, 11, 12, 13, 14, 17, 18, 19, 20)
    AND lht.location_id IN (2, 3, 11, 12, 13, 14, 15, 4, 16, 17, 18, 19, 20)
    GROUP BY product_id, HIERARCHY1_ID , HIERARCHY2_ID , HIERARCHY3_ID , location_id, year
    ) sales_time
    GROUP BY product_id, year,HIERARCHY1_ID, HIERARCHY2_ID
    This Query rewrites only with my_dim_mvw_calendar. (as saw in Query Plan and EXPLAIN_MVIEW). But we would like it to use my_dim_mvw_location as that has aggregations for both dimensions.

    blackhole001 wrote:
    Hi all,
    I'm trying to make my programmer's life easier by creating a database view for them to query the data, so they don't have to worry about joining tables. This sounds like a pretty horrible idea. I say this because you will eventually end up with programmers that know nothing about your data model and how to properly interact with it.
    Additionally, what you will get is a developer that takes one of your views and see's that of the 20 columns in it, it has 4 that he needs. If all those 4 columns comes from a simple 2 table join, but the view has 8 tables, you're wasting a tonne of resources by using the view (and heaven forbid they have to join that view to another view to get 4 of the 20 columns from that other view as well).
    Ideally you'd write stored routines that satisfy exactly what is required (if you are the database resource and these other programmers are java, .net, etc... based) and the front end developers would call those routines customized for an exact purpose.
    Creating views is not bad, but it's by no means a proper solution to having developers not learn or understand SQL and/or the data model.

  • Count(*) with nested query

    Hi,
    I have a question about the count(*) with nested query.
    I have a table T1 with these columns:
    C1 number
    C2 number
    C3 number
    C4 number
    C5 number
    (The type of each column is not relevant for the example.)
    This query:
    select C1, C2, C3, C4
    from T1
    group by C1, C2
    it's not correct becausa C3 and C4 are not columns specified in the GROUP BY expression.
    If if run this query:
    select count(*)
    from (select C1, C2, C3, C4
    from T1
    group by C1, C2)
    I haven't an error message (the result is correctly the number of records).
    Why?
    Thanks.
    Best regards,
    Luca

    Because you are just selecting count(*) and none of the columns from the subquery, Oracle is optimising it by ignoring the selected columns and just running the sub query with the group by columns. I know it seems odd, but if you take a basic example:
    SQL> ed
    Wrote file afiedt.buf
      1  select count(*)
      2  from (select empno, sal, mgr, deptno
      3  from emp
      4* group by deptno)
    SQL> /
      COUNT(*)
             3... all columns but deptno are ignored
    ... but if you include one of the other columns, even if you group by that column...
    SQL> ed
    Wrote file afiedt.buf
      1  select count(*), empno
      2  from (select empno, sal, mgr, deptno
      3  from emp
      4  group by deptno)
      5* group by empno
    SQL> /
    group by empno
    ERROR at line 5:
    ORA-00979: not a GROUP BY expression
    SQL>... the error returns, because you're forcing oracle to include the column in the subquery.

  • Importing SVG with nested clip-path

    I'm having serious issues in Illustrator CS5 trying to import SVG files with nested clip-path properties.
    Illutrator seems to create unnecessary groups, and messes up with group parents, effectively screwing things up.
    Here is a minimal example :
    <?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [<!ENTITY ns_svg "http://www.w3.org/2000/svg"><!ENTITY ns_xlink "http://www.w3.org/1999/xlink">]>
    <svg version="1.1" id="main" overflow="visible" xmlns="&ns_svg;" xmlns:xlink="http://www.w3.org/1999/xlink">
      <g id="piece-1">
        <g clip-path="url(#cpform)" id="form1">
          <g clip-path="url(#cplogo)" id="logo1">
                        <rect fill="#FF0000" x="10" y="10" width="1000" height="1000" />
          </g>
        </g>
      </g>
      <g transform="matrix(1,0,0,1,200,0)" id="piece-2">
        <g clip-path="url(#cpform)" id="form2">
          <g clip-path="url(#cplogo)" id="logo2">
                        <rect fill="#FF0000" x="10" y="10" width="1000" height="1000" />
          </g>
        </g>
      </g>
      <clipPath id="cpform">
              <rect x="0" y="0" width="150" height="150">
              </rect>
      </clipPath>
      <clipPath id="cplogo">
              <rect x="0" y="0" width="100" height="100">
              </rect>
      </clipPath>
    </svg>
    Such a valid SVG file displays fine in Chrome, IE, Opera, Firefox, but Illustrator fails loading it properly, because it creates two groups between "main" and "piece-1" (which is in itself not too bad), and sets piece-1 as a brother of another unnecesarry group from which piece-2 will descend. piece-2 and piece-1 are then clipped with piece-1 clip-path, which is just plain wrong and screws display.
    Note that you can move piece-2 to the root of the document, which restores the display. But save this fixed file, and open it again : it"s back to its broken state.
    Does anoyone know if this is fixed in CS6 ? If there is a workaround ?

    AI doesn't care for the original structure of an SVG. It will merely try to retain the appearance based on its own internal logic, which of course matches how you would create a normal AI file. So no, you can't probably avoid it.
    Mylenium

  • Trying to UNION two views with nested tables

    I am using Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod, and my objective is to generate some XML. What I have been doing in the past, is to create a view, and then pass that view to the DBMS_XMLQuery routine. This gives me a CLOB that I pass along to the application. A typical object would be something like:
    create or replace type XML_UGroup_Member_Type as object (
         username          varchar2(128),
         group_key          varchar2(128));
    create or replace type XML_UGroup_Member_List
        as table of XML_UGroup_Member_Type;
    show errors
    Create or replace type XML_UGroup_Type as object (
         Group_Space     varchar2(32),
         group_key     varchar2(128),
         group_name     varchar2(255),
         members          XML_UGroup_Member_List);
    /This particular application will be doing stuff with group information. Pretty simply types - a group with a name and a few other keys, and a list of members. A sample view would be like:
    create or replace view xml_department_ugroup_view of xml_ugroup_type
      with object identifier ( group_key ) as
      Select 'Department',
          'Department:' || orgn_code,
          'Department_' || orgn_name
          cast ( multiset (
               select  Username, person_id,
                        'Department:' ||  effective_orgn
                from directory_master dm, logins l
               where effective_orgn = dd.orgn_code
                 and dm.person_id = l.owner)
                as XML_UGroup_Member_List )
             as members
       from directory_departments dd
      where dept_include = 'Y';
    can select from this view, and I can pass it to the DBMS_XMLQUERY package and get a nice XML document. What I want to is essentially put several of these views together, like
    Select * from XML_Department_Ugroup_View
    Union
    Select * from XML_Portfolio_Ugroup_View;But UNION does not work with nested tables:
    ERROR at line 1: ORA-00932: inconsistent datatypes: expected - got SIMON.XML_UGROUP_MEMBER_LIST
    What I was hoping to do, was to develop a set of sub views for each of the group "spaces", and then generate a view/object that includes all of the sub views, and be able to operate with that single object.
    Thoughts on how to make this work, or on alternate approaches? I have considered calling XMLQuery on each of the sub views and concatenating the XML documents and returning that to the application, but I was hoping to find a more "unified" approach.

    I modified my approach a bit - I changed the base views to return an XMLType object, like:
    create or replace view xml_portfolio_ugroup_xml
    as
    Select XMLElement("group",
             xml_ugroup_type(
          'Portfolio',
             'Portfolio:' || coas_code || ':' || orgn_Code,
          cast ( multiset (
               select  Username,
                from directory_master dm, logins l
               where ( effective_orgn, effective_coas ) in
               where effective_orgn = dd.orgn_code
                  and dm.person_id = l.owner
                as XML_UGroup_Member_List ))) as grp
       from directory_departments dd
      where dept_include = 'Y';and then I combined them with something like the following (I expect to adjust this as I learn more about the XML DB support)
    create or replace view xml_ugroup_xml as
      select xmlconcat(
         (select xmlagg(grp) from xml_department_ugroup_xml),
         (select xmlagg(grp) from xml_portfolio_ugroup_xml)
         ) as GROUPS
         from dualand as I define more group branches, I can add them into the XMLConCat stanzas. I am still open to suggestions as to ways of doing this better or cleaner, but this at least gets the project moving forward again.

  • Help with Auto calculations

    I have an existing pdf that i am trying to edit and make it more functional...i.e. fillable info with auto calculations of cost based on a given number (times a specific cost)
    Example on the form....
    Car Registrations (per car) _____ X $25 _________
    The first line above is # Cars Registered
    The last line is Total Cost
    The blank lines above i have added a text box to for auto calculations. I have formated these boxes as numbers (first line) and dollar value total (second line)
    I've added another text box for the $25 and placed it overtop the worded one. I've locked this box and the total box. I've calculated the product of the total box by linking it to the first line and the $25 to give the total cost...
    Problem is, it isnt working....the total box isn't seeing the $25 to give a proper calc. Whatever number i place in the first line, only zero shows in the total.
    I'm obviously missing something....been at this for two days....frustrated. I have many more inputs like this on the form, and eventually want all the totals to provide sub totals and a grand total. I understand how this all works to a degree, doesnt seem that difficult, but i have to be missing something.
    I even tried re-creating the document in word, input to adobe, make a new form, let the system recoginize areas as fillable, etc, etc, etc. When i get to the calculations portion, same result...there are not many tutorials out there on this...sadly
    Woking on a MAC...
    I have acrobat X Pro

    gr8snkbite wrote:
    I have an existing pdf that i am trying to edit and make it more functional...i.e. fillable info with auto calculations of cost based on a given number (times a specific cost)
    Example on the form....
    Car Registrations (per car) _____ X $25 _________
    The first line above is # Cars Registered
    The last line is Total Cost
    The blank lines above i have added a text box to for auto calculations. I have formated these boxes as numbers (first line) and dollar value total (second line)
    I've added another text box for the $25 and placed it overtop the worded one. I've locked this box and the total box. I've calculated the product of the total box by linking it to the first line and the $25 to give the total cost...
    Problem is, it isnt working....the total box isn't seeing the $25 to give a proper calc. Whatever number i place in the first line, only zero shows in the total.
    I'm obviously missing something....been at this for two days....frustrated. I have many more inputs like this on the form, and eventually want all the totals to provide sub totals and a grand total. I understand how this all works to a degree, doesnt seem that difficult, but i have to be missing something.
    I even tried re-creating the document in word, input to adobe, make a new form, let the system recoginize areas as fillable, etc, etc, etc. When i get to the calculations portion, same result...there are not many tutorials out there on this...sadly
    Woking on a MAC...
    I have acrobat X Pro
    I created your sample.
    name the field after Number  of cars, as car
    The calulation field named total

  • In a group text with two phones that use Imessage and one that does not. The person that does not, does not get my message when its sent in group text. How do i fix this?

    I have a group text with two of my friends. here's each person break down
    person 1 ATT network, using imessage
    person 2 verzion network, using imessage
    person 3 verzion network, using SMS
    All three of us are in a group chat. When person 1 sends a message, person 2 recieves it, but person 3 does not. Then when person 3 sends a message, both person 1 and 2 get it. When person 2 sends an Imessage, person 1 and 3 get it
    so the problem is when person 1 sends an imessage, it doesnt change to sms and person 3 doesnt get it, but person 2's automatilly switches it to green.
    How can person one get their phone to automaticlly switch it to green in group message while keeping on imessage?

    The quote below from http://support.apple.com/kb/HT5760 indicates that it in the situation you describe it should be going as MMS to everyone -- which is not what you are seeing actually happen (and also not what you want to happen if I understand correctly). There may be something else helpful in the link.
    Group messages will be sent using iMessage if all recipients have iMessage enabled. If not, the conversation will be sent as MMS. Group messages use MMS even if the content is text only.

  • Problem with the calculator and modifications needed

    i have got a problem with the calculator on my iphone i.e i cannot find any DEL key or Backspace....the problem is when typing a long value if one number is entered wrong we should start again.
    EXAMPLE...if i need to type    114678047 * 345612
    if acidentally if i type 114678047 * 3455           ( then i should start over typing  "C"  key)
    i should start over to type the whole data..if we have a delete key we can just correct it right away and continue.....rather than starting over
    we can find this feature in all the other smart phones , i dont know why apple coudnt find that
    even every scientific calculator have a DEL key...
    Thanks
    vickyk7

    FEEDBACK
    If you want to give Apple feed back then do it here http://www.apple.com/feedback/iphone.html

  • Error in communicating with Excel Calculation Services

    When attempting to use Excel Web Access web part, I get "We're sorry. We ran into a problem completing your request. Please try that again in a few minutes."
    Checked event log and found
    There was an error in communicating with Excel Calculation Services
    http://my server:32843/49082a5d56c141629497dd8b28375f47/ExcelService*.asmx exception: The remote server returned an error: (503) Server Unavailable.
    [Session:
    User: ].
    I googled the error and, as suggested by various sources, rebooted the server. (Same issue occurs) I also tried disabling asp.net impersonation with no change.  Ideas?

    Hi ,
    Reason for the error :
    The Excel Services Application server computer is in a non-valid state and may need to be restarted.
    Resolution : (Before taking the step toward to restart the server, try the below option)
    Restart your excel service application app pool/ restart the excel service. (Reference :http://technet.microsoft.com/en-us/library/ee513104(v=office.14).aspx)
    If you have more than one application server in the farm , then try start the excel serviceto a different server.
    Regards,
    Senthil

  • How to restrict users working on Windows 7 clients from accessing Windows Explorer and other systems in the network through Group Policy with a domain controller running on Windows Server 2008 r2

    Dear All,
    We are having an infrastructure setup of around 500 client computers managed through group policy.
    Recently the domain controllers have been migrated from Windows Server 2003 to Server 2008 R2.
    Since this account requires extremely strict environment, we need to figure the solution for restricting the users from access anything locally.
    It would be great if you can assist me with the following query.
    How to restrict users logged on Windows 7 clients from accessing Windows Explorer and browsing other systems in the network through Group Policy with a domain controller running on Windows Server 2008 r2 ?
    Can we disable Network Tab on the left hand pane ?
    explorer.exe is blocked already, but users are able to enter the Windows Explorer by clicking on the name which is visible on the Start Menu.

    >   * explorer.exe is blocked already, but users are able to enter the
    >     Windows Explorer by clicking on the name which is visible on the
    >     Start Menu.
    You cannot block explorer.exe when you do not replace the shell - the
    desktop you see effectively IS explorer.exe...
    Your requirement sounds like you need a custom shell:
    http://gpsearch.azurewebsites.net/#2812
    Martin
    Mal ein
    GUTES Buch über GPOs lesen?
    NO THEY ARE NOT EVIL, if you know what you are doing:
    Good or bad GPOs?
    And if IT bothers me - coke bottle design refreshment :))

  • Issues with nested for loops - saving images from a camera

    Hi all,
    I've written a vi. to capture a specific number of images ('Image No') and save these images, outputted to a folder of my choice.  Each image is identified sequentially.  However, I wish to do a number of iterations ('Run') of this capture sequence, such that the filename of each image would be 'Filename (Run)_(Image No).png', e.g. run 5, image 10 would be 'Filename 5_10.png'.  I have tried a nested for loop for this but I receive an error 'Asynchronous I/O operation in progress' (I've attached a printscreen).
    Can anyone assist me in solving this problem? I preiously posted this in machine Vision but got no response (http://forums.ni.com/t5/Machine-Vision/Capturing-image-sequences-issues-with-nested-for-loops/m-p/19...).  Please find attached my vi.
    Kindest regards and thanks,
    Miika
    Solved!
    Go to Solution.
    Attachments:
    Labview problem.jpg ‏3841 KB
    Image sequence save to file.vi ‏48 KB

    Miika,
    the problem is not the filenam, but the name of the folder (AHHHHH!). You try to create the same folder in the outer for loop over and over again.... (it is the error message above the '======', not below )
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Group Text with Android Doesn't Work

    Hi- I had been using an iPhone for a few years, and decided to switch over to Android. It took some time to get my phone number disassociated from iMessage/iCloud, but I was eventually able to get that done. Since iOS8 came out, though, I'm starting to experience problems again. Specifically, whenever I group text with multiple iPhone users, everything works fine -- until my wife (an iPhone 6 user) is added into the group. When this happens, everything automatically switches back to iMessage and I stop receiving any messages.
    Has anyone else experienced this? Are there any fixes?
    Thanks

    Just in case other people found my post by Googling, here is my fix I added to my post on the OpenOffice forum.
    Re: Text to speech only reads the document title  
    by Trish8 » Sat Feb 14, 2015 9:58 am
    I tried as many suggestions as I could from the plethora of suggestions above. I'm sure you are correct, it must be the Mac's problem. I took a chance and downloaded LibreOffice; Text to Speech now works the same as it does on TextEdit, the internet, and PdF. Thanks for all the help, I mean that sincerely. OpenOffice is a really fine product.
    Patt

Maybe you are looking for

  • When Adobe After Effect Opren Error Message Quick Time not Install?

    After opening Adobe Effect I got an message Quick Time is not installed might b some tools won't work. Even I installed a latest quick time software but still got this message. Can anyone help me how to sort out this issue. Thanks in advance Kind Reg

  • RequestDispatcher issue in app

    Hello there, I am trying to invoke a jsp file named subscription.jsp. subscription.jsp has a submit button. When the button is clicked it calls the display.jsp page displays the passed ID's in url request. I am invoking the jsp file as http://localho

  • Save an edited picture as new

    Hi! I have a simple question (I think). I have edited some pictures in iPhoto '11 and would like to have them as a standard .jpg or whatever. How do I do? Jonas

  • Why the partner usuage tab is suppresed in account group for SH,BP,and PY

    Hi All, why the partner usuage tab is suppresed in account group for ship to party, bill to party and payer. Regards, MAllesh.

  • How do i get the mini-player on the bottom bar

    I used to be able to get the bottom mini-played on the bottom of my screen, right next to the icons on the taskbar. In the right hand corner!!! But now it won't do that I have 6.0.4 and I've gone through all the prefences, any ideas??? <333 thank you